Re: [racket] problem with pict-bitmap and mrlib/write-animated-gif

2014-10-02 Thread Martin DeMello
I will; I just want to play with it for a bit first and make sure I'm doing the right thing. martin On Tue, Sep 30, 2014 at 10:02 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: Hi Martin, 2014-09-28 0:46 GMT+02:00 Martin DeMello martindeme...@gmail.com: Solved, with help from Jens

Re: [racket] Defining a typed language

2014-10-02 Thread Matthias Felleisen
Konrad, I am surprised you want to remove contracts from Typed-Untyped boundaries given your history of praising types on this mailing list. But yes, you're on the right track. On Oct 2, 2014, at 1:18 AM, Konrad Hinsen konrad.hin...@fastmail.net wrote: Konrad Hinsen writes: Then, a

Re: [racket] Understanding contracts

2014-10-02 Thread Matthias Felleisen
Let's make Spencer's question concrete. Say we have this situation: #lang racket ;; contracts set up boundaries between two regions of a program, say two modules ;; --- ;; the library (module

Re: [racket] Puzzled about type inference

2014-10-02 Thread Neil Toronto
[rather later] When can I have this wonderful thing? As it is, I insert (ann e Void) to discover the type that TR gives `e`. The type error is very informative. With `case-` types, as you say, it can get tricky to find out which combination of argument types produces which type for any

Re: [racket] Defining a typed language

2014-10-02 Thread Konrad Hinsen
Matthias Felleisen writes: Konrad, I am surprised you want to remove contracts from Typed-Untyped boundaries given your history of praising types on this mailing list. But yes, you're on the right track. I don't want to remove contracts from the boundaries, I want to remove the boundaries

Re: [racket] Puzzled about type inference

2014-10-02 Thread Vincent St-Amour
At Thu, 02 Oct 2014 09:23:19 -0400, Neil Toronto wrote: With `case-` types, as you say, it can get tricky to find out which combination of argument types produces which type for any given `e` in the function body. It might work out to just keep the types in order and number them. Would

Re: [racket] Preliminary support for Racket on EV3

2014-10-02 Thread Tomi Pieviläinen
Couple more questions: Is the use of defines inside let different from using let*? And does #%datum actually need to be exported? Based on documentation and trying it seems like it doesn't actually touch the new literals since they are treated as symbols. -- Tomi Pieviläinen, +358 400 487 504 A:

Re: [racket] Understanding contracts

2014-10-02 Thread Alexander McLin
Spencer, I'm calling cubic-bezier from within a (module+ test (require submod ..)...) form that itself is defined in the file where cubic-bezier is defined. Also I tried from within REPL and requiring the code file. Matthias, I ran your example and it works exactly the way I wanted. The lambda

Re: [racket] Understanding contracts

2014-10-02 Thread Matthias Felleisen
If you use this as the program: #lang racket ;; contracts set up boundaries between two regions of a program, say two modules ;; --- ;; the library (provide (contract-out [struct

[racket] Minimum OS X version to support?

2014-10-02 Thread John Clements
I'm recompiling dylibs for OS X, and it occurs to me to wonder whether I should still have -mmacosx-version-min=10.5 in my raco ctool call. Does racket 6+ still support OS X 10.5? Thanks! John Racket Users list: http://lists.racket-lang.org/users

[racket] Best practices for classes

2014-10-02 Thread Matthew Butterick
What's the best approach to: + defining a class whose instances can be used as procedures? (define ci (new proc-class%)) (ci arg arg2 ... ) + ... whose instances can be used as lists (or at least support direct iteration?) (define li (new listish-class%)) (for-each displayln li) (map ci li)

Re: [racket] Minimum OS X version to support?

2014-10-02 Thread Matthew Flatt
Yes, 10.5 is the minimum supported version. At Thu, 2 Oct 2014 13:45:23 -0700, John Clements wrote: I'm recompiling dylibs for OS X, and it occurs to me to wonder whether I should still have -mmacosx-version-min=10.5 in my raco ctool call. Does racket 6+ still support OS X 10.5?

Re: [racket] Puzzled about type inference

2014-10-02 Thread Robby Findler
I've just pushed a change to check syntax that picks up tooltip syntax properties in syntax objects that it sees. See the docs for mouse-over-tooltips. Robby On Thu, Oct 2, 2014 at 8:23 AM, Neil Toronto neil.toro...@gmail.com wrote: [rather later] When can I have this wonderful thing? As it

[racket] macro question

2014-10-02 Thread Kevin Forchione
Hi guys, Why does this appear to work? I assume it’s not a recommended approach. #lang racket (require (for-syntax syntax/parse)) (define-syntax (mylet stx) (let ([val (syntax-case stx () [(_ x) #'x] [(_ x xs ...) #'(cons x (mylet xs ...))])]) val)) (mylet

Re: [racket] macro question

2014-10-02 Thread Sean Kanaley
(let ([x y]) x) = y That let is just a wrapper that equals y. So your macro is really (define-syntax (mylet stx) (syntax-case stx () [(_ x) #'x] [(_ x xs ...) #'(cons x (mylet xs ...))])]) Which causes (mylet 1 2 3) = '(1 2 . 3) ;don't forget the dot! And that's just the macro

Re: [racket] macro question

2014-10-02 Thread Ryan Culpepper
On 10/02/2014 09:19 PM, Kevin Forchione wrote: Hi guys, Why does this appear to work? I assume it’s not a recommended approach. #lang racket (require (for-syntax syntax/parse)) (define-syntax (mylet stx) (let ([val (syntax-case stx () [(_ x) #'x] [(_ x xs

Re: [racket] Best practices for classes

2014-10-02 Thread Alexander D. Knauth
I don’t know if you can do it with generic interfaces (as in racket/generic), but you can make classes whose instances have struct-type properties such as prop:procedure and prop:sequence (using interfaces as in racket/class, not racket/generic) #lang racket (define proc% (interface* ()

Re: [racket] macro question

2014-10-02 Thread Kevin Forchione
On Oct 2, 2014, at 6:53 PM, Ryan Culpepper ry...@ccs.neu.edu wrote: On 10/02/2014 09:19 PM, Kevin Forchione wrote: Hi guys, Why does this appear to work? I assume it’s not a recommended approach. #lang racket (require (for-syntax syntax/parse)) (define-syntax (mylet stx) (let

Re: [racket] macro question

2014-10-02 Thread Neil Van Dyke
If you're not already using DrRacket's awesome Macro Stepper, give it a try, to see how your examples expand. Neil V. Racket Users list: http://lists.racket-lang.org/users