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] typed racket and interfaces

2014-05-02 Thread dfeltey
There is some documentation in the pre-release docs at http://www.cs.utah.edu/plt/snapshots/current/doc/ts-reference/Typed_Classes.html?q=Class #:implements should be used inside of a Class type form. The following is an example from the documentation: > (define-type Point<%> (Class (field [x

[racket] prefix/rename for signatures in unit and define-signature forms

2014-05-08 Thread dfeltey
I'm trying to make sense of how prefix/rename work for signatures, but in trying to run some examples the actual implementation doesn't seem to match either my intuition or the documentation. For example I have the following simple signature: (define-signature a^ (a)) I then try to build a ne

Re: [racket] prefix/rename for signatures in unit and define-signature forms

2014-05-09 Thread dfeltey
I've been digging in to this some more, and it seems that the prefix form works backwards on a sig-spec, for example: (define-signature a^ (a)) (define-signature dcc^ ((open (prefix d: (prefix c: (prefix c: a^)) (define d@ (unit (import dcc^) (export) c:c:d:a)) (unit (import) (export (

Re: [racket] Type of argument in a function

2014-07-20 Thread dfeltey
Have you looked into Typed Racket? http://docs.racket-lang.org/ts-guide/index.html You can write things similar to the following: (define (f [x : Number]) : Number x) - Original Message - From: "קוראל אלימלך" To: users@racket-lang.org Sent: Sunday, July 20, 2014 7:04:39 AM GMT -05:0

Re: [racket] Redex: exponential runtime with certain judgments

2014-07-24 Thread dfeltey
I'm attaching a model of the simply typed lambda calculus which demonstrates the issue. The file includes a language definition, the necessary judgment forms, and a few macros for generating and timing programs of a given size. I hope this helps. Thanks Dan - Original Message - From:

Re: [racket] contracts ->i optional keyword syntax

2014-08-23 Thread dfeltey
Keywords should be followed by an id+ctc as described in the documentation, so something like the following should work (->i ([lst list?]) (#:foo [foo (lst) foo?]) (result list?)) Hope this helps Dan - Original Message - From: "Kevin Forchione" To: "Racket Users" Sent: