chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] basic question regarding interfaces


From: Martin Schneeweis
Subject: Re: [Chicken-hackers] basic question regarding interfaces
Date: Fri, 6 Jul 2018 20:55:02 +0200

Hi Felix,

thank's for your reply.

> Drop the "export" from your "define-interface" forms

I could have sworn that I started my journey without the "export".

Anyway - both problems persists - may I please ask you to take a second
look if I make another error?

Module that implements two interfaces (chicken 5) - the module compiles,
but "some-b" is not visible outside. (And the compiler does not even
complain if I remove the implementation of "some-b" - nothing changes
by the way if I change the export to "(interface: iface-a iface-b)"

  (define-interface iface-a (some-a))
  (define-interface iface-b (some-b))
  
  (module two-ifaces (
      (interface: iface-a)
      (interface: iface-b))
    (import scheme (chicken base))
    
    (define some-a (lambda ()
      (print "a")))
      
    (define some-b (lambda ()
      (print "b"))))

And here is a module with an extra export where "extra-a" is not visible
outside the module (to make it visible the "extra-a" and
"(interface: iface-a)" have to change place):

  (define-interface iface-a (some-a))
  
  (module one-extra-iface-wrong (
      (interface: iface-a)
      extra-a)
    (import scheme (chicken base))
    
    (define extra-a (lambda ()
      (print "extra a")))
      
    (define some-a (lambda ()
      (print "a"))))

lg
Martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]