Re: [racket] parser tools - defining tokens

2011-10-08 Thread Ryan Culpepper
On 10/04/2011 01:21 PM, George Neuner wrote: Hi all, I am playing with the parser tools in Racket. I would like to be able pass a separately defined list of symbols to define-empty-tokens (which is a syntax macro defined in parser-tools/private-lex/token.rkt). Unfortunately passing a list to def

Re: [racket] Making a contract between a function and "the world in general"

2011-10-08 Thread Ryan Culpepper
On 10/08/2011 10:12 AM, Matthias Felleisen wrote: [...] (2) I object to provide-with-whatever-contract-you-already-have because I think programmers should explicitly state what they want (if they want something logical). We can already do this (define primes-to-primes (-> (listof prime?

Re: [racket] Confusion with syntax marks

2011-10-08 Thread Eric Dobson
Thanks. That is what I eventually figured out I needed to do. Also the original problem was a bug in the Macro Stepper, pr12248, which only added to my confusion. -Eric On Oct 8, 2011, at 12:18 PM, Marco Maggi wrote: > Eric Dobson wrote: > >> I am playing around with syntax marks and have a

Re: [racket] Confusion with syntax marks

2011-10-08 Thread Marco Maggi
Eric Dobson wrote: > I am playing around with syntax marks and have a program > whose output confuses me. > > #lang racket > (require (for-syntax racket/syntax)) > (define-for-syntax marker (make-syntax-introducer)) > (define-syntax (mark stx) > (syntax-case stx () > ((_ arg ...) (marker #

Re: [racket] Low level manipulation on numbers

2011-10-08 Thread nicolas.o...@gmail.com
Thank you so much for your very quick answer. It seems that the conversion to and from bytes are what I was looking for. With that, it is quite easy to do all the manipulations I want. Best, Nicolas. On Sat, Oct 8, 2011 at 6:57 PM, Matthew Flatt wrote: > At Sat, 8 Oct 2011 17:41:35 +0100, "ni

Re: [racket] Low level manipulation on numbers

2011-10-08 Thread Matthew Flatt
At Sat, 8 Oct 2011 17:41:35 +0100, "nicolas.o...@gmail.com" wrote: > I am trying to write a small implementation of Protocol Buffers ( > http://code.google.com/p/protobuf/ ) and I have difficulties > with bit manipulations, especially to transform a negative integer into a > series of bytes and ba

Re: [racket] Making a contract between a function and "the world in general"

2011-10-08 Thread Matthias Felleisen
On Oct 8, 2011, at 12:48 PM, Neil Toronto wrote: > On 10/08/2011 10:12 AM, Matthias Felleisen wrote: >> >> (1) I do not understand Neil's problem. Say I have module A and >> want to protect its exports from abuses by clients, say module B, >> why do you use define/contract at all? The define/con

Re: [racket] Making a contract between a function and "the world in general"

2011-10-08 Thread Neil Toronto
On 10/08/2011 10:12 AM, Matthias Felleisen wrote: (1) I do not understand Neil's problem. Say I have module A and want to protect its exports from abuses by clients, say module B, why do you use define/contract at all? The define/contract form is for splitting modules into module-lets -- in case

[racket] Low level manipulation on numbers

2011-10-08 Thread nicolas.o...@gmail.com
Dear all, I am trying to write a small implementation of Protocol Buffers ( http://code.google.com/p/protobuf/ ) and I have difficulties with bit manipulations, especially to transform a negative integer into a series of bytes and back. I can not find an implementation of a non-arithmetic shift

Re: [racket] Making a contract between a function and "the world in general"

2011-10-08 Thread Matthias Felleisen
(1) I do not understand Neil's problem. Say I have module A and want to protect its exports from abuses by clients, say module B, why do you use define/contract at all? The define/contract form is for splitting modules into module-lets -- in case your module is too large and you can't manage inv