Re: [racket] Extending syntax-parameters?

2012-10-16 Thread Eli Barzilay
20 minutes ago, John Clements wrote: > > On Oct 16, 2012, at 7:16 PM, Eli Barzilay wrote: > > > So you need to grab it outside of the new tansformer, just like > > with plain parameters and closures. > > just like with plain parameters? that doesn't sound right to me: > > #lang racket > > (def

Re: [racket] Extending syntax-parameters?

2012-10-16 Thread John Clements
On Oct 16, 2012, at 7:16 PM, Eli Barzilay wrote: > 20 minutes ago, J. Ian Johnson wrote: >> I have a syntax parameter that is bound to a transformer. I want to >> (at certain points) change the parameterization of this parameter to >> a new transformer that depends on the old one. >> >> I can't

Re: [racket] Extending syntax-parameters?

2012-10-16 Thread Eli Barzilay
20 minutes ago, J. Ian Johnson wrote: > I have a syntax parameter that is bound to a transformer. I want to > (at certain points) change the parameterization of this parameter to > a new transformer that depends on the old one. > > I can't do this: > #'(syntax-parameterize ([p (syntax-parser >

[racket] Extending syntax-parameters?

2012-10-16 Thread J. Ian Johnson
I have a syntax parameter that is bound to a transformer. I want to (at certain points) change the parameterization of this parameter to a new transformer that depends on the old one. I can't do this: #'(syntax-parameterize ([p (syntax-parser [pat (some-combination-of

Re: [racket] wffi (a "literate" web service "FFI" using a markdown file with parameterized HTTP messages)

2012-10-16 Thread Greg Hendershott
To follow up, I just pushed a PLaneT package for the Google API Discovery service, which means ~40 Google web services including things like goo.gl, Google+, and so on. GitHub: https://github.com/greghendershott/gapi PLaneT: http://planet.racket-lang.org/display.ss?package=gapi.plt&owner=gh Discl

[racket] general shout-out for syntax-parameterize and the macro stepper

2012-10-16 Thread John Clements
I just had a really really nice everything-going-the-way-I-expected experience with syntax-parameterize and the macro stepper. In the case of syntax-parameterize, my judgment may be clouded by my pleasure in getting things working. The macro stepper, though, was just exactly what I needed; I'm

Re: [racket] Function composition in Racket

2012-10-16 Thread Gregory Woodhouse
Indeed it does! These plots are very nice. On Oct 16, 2012, at 1:35 PM, Neil Toronto wrote: > On 10/16/2012 12:02 PM, Michael Wilber wrote: >> Does surface3d and isosurface3d from racket/plot do what you want? >> >> file:///usr/share/racket/doc/plot/renderer3d.html?q=isosurface#(def._((lib._plo

Re: [racket] macros whose meaning is dependent on context?

2012-10-16 Thread Eli Barzilay
A few minutes ago, John Clements wrote: > > On Oct 16, 2012, at 3:25 PM, Jon Rafkind wrote: > > > This is what syntax-parameters are for. > > > > (require racket/stxparam) > > (define-syntax-parameter m (lambda (stx) (raise-syntax-error 'm "dont use > > this outside deeper"))) > > > > (define-

Re: [racket] macros whose meaning is dependent on context?

2012-10-16 Thread John Clements
On Oct 16, 2012, at 3:25 PM, Jon Rafkind wrote: > This is what syntax-parameters are for. > > (require racket/stxparam) > (define-syntax-parameter m (lambda (stx) (raise-syntax-error 'm "dont use > this outside deeper"))) > > (define-syntax-rule (deeper e) >(syntax-parameterize ([m (lambda

Re: [racket] macros whose meaning is dependent on context?

2012-10-16 Thread John Clements
On Oct 16, 2012, at 3:18 PM, John Clements wrote: > This seems like a straightforward question; apologies if I just haven't dug > deep enough to find the answer. Gah! There's a syntax-parameterize form? Okay, I just saw this float by in a commit message, and it sounds like that's the one I wa

Re: [racket] macros whose meaning is dependent on context?

2012-10-16 Thread Jon Rafkind
This is what syntax-parameters are for. (require racket/stxparam) (define-syntax-parameter m (lambda (stx) (raise-syntax-error 'm "dont use this outside deeper"))) (define-syntax-rule (deeper e) (syntax-parameterize ([m (lambda (stx) #'1)]) e)) (deeper (m)) -> 1 On 10/16/2012 04:18 PM

[racket] macros whose meaning is dependent on context?

2012-10-16 Thread John Clements
This seems like a straightforward question; apologies if I just haven't dug deep enough to find the answer. I want to define a macro whose meaning depends on its context. More specifically, I want to define an "outer" macro that gives a particular meaning to the "inner" macro. I can see how t

Re: [racket] Internal definition contexts for phase 1?

2012-10-16 Thread Ryan Culpepper
On 10/16/2012 03:54 PM, J. Ian Johnson wrote: I'm doing a bit of macrobatics where I'm creating a series of definitions, during which I want to also do define-for-syntax for some syntax transformers that are used in a produced syntax-parameterize form. In a top level call to this macro, things

Re: [racket] Re-inventing dataflow languages

2012-10-16 Thread John Clements
On Oct 12, 2012, at 11:22 AM, Tony Garnock-Jones wrote: > On 10/11/2012 07:26 PM, John Clements wrote: >> I can imagine doing something more complicated, but what I really want to >> ask is this: for those of you with experience in other dataflow languages, >> how do they solve this? > > The s

Re: [racket] Function composition in Racket

2012-10-16 Thread Neil Toronto
On 10/16/2012 12:02 PM, Michael Wilber wrote: Does surface3d and isosurface3d from racket/plot do what you want? file:///usr/share/racket/doc/plot/renderer3d.html?q=isosurface#(def._((lib._plot/main..rkt)._isosurface3d)) In particular: #lang racket (require plot) (define (f x y) (+ 2 (* 2

[racket] Internal definition contexts for phase 1?

2012-10-16 Thread J. Ian Johnson
I'm doing a bit of macrobatics where I'm creating a series of definitions, during which I want to also do define-for-syntax for some syntax transformers that are used in a produced syntax-parameterize form. In a top level call to this macro, things would be fine. However, I set up some syntax p

Re: [racket] Function composition in Racket

2012-10-16 Thread Michael Wilber
Does surface3d and isosurface3d from racket/plot do what you want? file:///usr/share/racket/doc/plot/renderer3d.html?q=isosurface#(def._((lib._plot/main..rkt)._isosurface3d)) Gregory Woodhouse writes: > I'm intrigued. I suppose pattern based macros could be used to implement > operations like +

Re: [racket] Function composition in Racket

2012-10-16 Thread Gregory Woodhouse
I'm intrigued. I suppose pattern based macros could be used to implement operations like + and *, and passing to the field of quotients should formally be no different from rational arithmetic. Are you interested in Chebyshev polynomials for a particular reason (e.g, applications to differential

Re: [racket] Function composition in Racket

2012-10-16 Thread Neil Toronto
I hadn't thought of making two passes. Thanks! I'd have to have the terms indexed by two different orderings (nondecreasing in x's degree and nondecreasing in y's), or be willing to sort. That seems tricky or slowish, but much better than what I've had in mind. It should also work with other o