Re: [racket] Confused about define-values(-for-export) forms in define-signature

2014-04-03 Thread Matthias Felleisen
On Apr 3, 2014, at 9:04 AM, Matthew Flatt wrote: > In other words, defining a variable in a signature is a lot like > defining a method in an Java interface. Defining `y` as a constant is > not especially useful If you follow the Java precedent, it is somewhat useful to have interfaces that d

Re: [racket] Confused about define-values(-for-export) forms in define-signature

2014-04-03 Thread Matthew Flatt
At Thu, 3 Apr 2014 02:49:23 -0400 (EDT), dfel...@ccs.neu.edu wrote: > > A `define-values` in a signature adds a definition to any *importing* > > context (in contrast to `define-values-for-export` which adds a > > definition in any *exporting* context). The `define-values/invoke-unit` > > form "imp

Re: [racket] Confused about define-values(-for-export) forms in define-signature

2014-04-02 Thread dfeltey
> A `define-values` in a signature adds a definition to any *importing* > context (in contrast to `define-values-for-export` which adds a > definition in any *exporting* context). The `define-values/invoke-unit` > form "imports" the signature into the definition context. I reread the documentation

Re: [racket] Confused about define-values(-for-export) forms in define-signature

2014-04-02 Thread Matthias Felleisen
On Apr 2, 2014, at 5:41 PM, Matthew Flatt wrote: >> >> What confuses me is that I can also define the following signature and unit: >> >> (define-signature y^ >> ((define-values (y) 5))) >> >> (define y@ >> (unit (import) >>(export y^))) >> >> (define-values/invoke-unit y@ (import)

Re: [racket] Confused about define-values(-for-export) forms in define-signature

2014-04-02 Thread Matthew Flatt
At Tue, 1 Apr 2014 02:29:17 -0400 (EDT), Daniel Feltey wrote: > The define-signature form allows define-values and define-values-for-export > forms in its body. According to the documentation the define-values form > should > prefix any unit that imports the signature, and define-values-for-expo