Thanks Danny,
I've changed the syntax of the macro as follows by faking keyword
arguments prompt: and handler: and it works now as far as I can tell.
I saw some discussion on the dev list about keyword parameters and
syntax but I didn't quite follow it, so I wasn't sure if it was saying
that keyw
Thanks Danny,
Its obvious now that you point it out.
On Sun, Sep 2, 2012 at 12:27 AM, Danny Yoo wrote:
>> (let/set-prompt prompt-3 ()
>> (+ 1000
>>(abort-to-prompt p 0)
>>2000))
>>
>> ==>
>>
>> (call-with-continuation-prompt
>> (let () (λ
> (let/set-prompt prompt-3 ()
> (+ 1000
>(abort-to-prompt p 0)
>2000))
>
> ==>
>
> (call-with-continuation-prompt
> (let () (λ ()
>+
>1000
>(abort-to-prompt p 0)
>2000))
> prompt-3)
>
>
>
> And
> So I tried modifying the macro to the following.
>
> ;(let/set-prompt args prompt (body ...))
> (define-syntax let/set-prompt
> (syntax-rules ()
> [(_ARGS (BODY ...)) (call-with-continuation-prompt
> (let ARGS (λ () BODY ...)))]
> [(_ PROMPT ARGS (BODY ...)) (cal
Dear list members,
I'm trying to work my way through Racket continuations by going
through the Guide and Reference. And as part of that I set up small
examples and sometimes macros to simplify the syntax so I can see more
clearly whats going on.
So I made a let type form of call-with-continuatio
2011/8/12 Racket Noob :
> It's a sad thing that I cannot find a book or text as clear as PG's "On
> Lisp" that covers Racket's hygienic macros in such detailed manner. :(
Be sure to read TSPL's section on syntax-rules and syntax-case and
work through all of the problems.
_
2011/8/12 Racket Noob :
> Thank you, beautiful people!
>
> I'll take a look at Dybvig's article.
Also:
http://blog.racket-lang.org/2011/04/writing-syntax-case-macros.html
Hmmm... we need some consolidation. This material belongs in the Guide.
__
Racket Noob
> Date: Fri, 12 Aug 2011 11:05:30 -0500
> Subject: Re: [racket] Problem with macro
> From: clkl...@eecs.northwestern.edu
> To: d...@cs.wpi.edu
> CC: racketn...@hotmail.com; users@racket-lang.org; ro...@eecs.northwestern.edu
>
> On Fri, Aug 12, 2011 at 10:44 A
On Fri, Aug 12, 2011 at 10:44 AM, Danny Yoo wrote:
> Kent Dybvig's tutorial on syntax case was helpful for me:
>
> http://www.cs.indiana.edu/~dyb/pubs/tr356.pdf
>
I second that recommendation. It was a huge help to me when learning
to write macros in Racket.
__
> Oh, that's my problem: i obviously don't understand what's the places where
> macro expansion happens.
> I ended up writing "classical" lisp non-hygienic macro instead.
>
> It's a sad thing that I cannot find a book or text as clear as PG's "On
> Lisp" that covers Racket's hygienic macros in suc
Neil Van Dyke writes:
> (Pardon the writing in enumerations, but someone erroneously put caf
> coffee in the decaf coffee carafe.)
Say *that* ten times fast.
_
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo/users
On Fri, Aug 12, 2011 at 9:22 AM, Neil Van Dyke wrote:
> 1. Without trying it, I'm pretty sure this particular syntax transformation
> can be done in "syntax-rules", but I'm not certain it can be done using only
> the power of "..." in "syntax-rules", without a helper macro. Your life
> might be e
27;r)
endstate
Shriram's approach (described here:
http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/paper.pdf
) forces us to give input all in one take.
Racket Noob
> Date: Fri, 12 Aug 2011 10:22:18 -0400
> From: n...@neilvandyke.org
> To: racketn.
1. Without trying it, I'm pretty sure this particular syntax
transformation can be done in "syntax-rules", but I'm not certain it can
be done using only the power of "..." in "syntax-rules", without a
helper macro. Your life might be easier if you do this particular
transformation in "syntax-c
that covers Racket's hygienic macros in such detailed manner. :(
Racket Noob
> Date: Fri, 12 Aug 2011 07:39:16 -0500
> Subject: Re: [racket] Problem with macro
> From: ro...@eecs.northwestern.edu
> To: clkl...@eecs.northwestern.edu
> CC: jay.mccar...@gmail.com; users@racket-l
On Fri, Aug 12, 2011 at 7:49 AM, Casey Klein
wrote:
> On Fri, Aug 12, 2011 at 7:39 AM, Robby Findler
> wrote:
>> Unfortunately, that position in a 'case' expression is not a place
>> where macro expansion happens. You can, however, use a 'cond' instead
>> of 'case'.
>>
>
> But you still can't use
On Fri, Aug 12, 2011 at 7:39 AM, Robby Findler
wrote:
> Unfortunately, that position in a 'case' expression is not a place
> where macro expansion happens. You can, however, use a 'cond' instead
> of 'case'.
>
But you still can't use a macro like `process-state' to generate an
entire `cond' claus
Unfortunately, that position in a 'case' expression is not a place
where macro expansion happens. You can, however, use a 'cond' instead
of 'case'.
Robby
On Fri, Aug 12, 2011 at 7:33 AM, Casey Klein
wrote:
> On Fri, Aug 12, 2011 at 7:26 AM, Jay McCarthy wrote:
>> 2011/8/11 Racket Noob :
>>>
>>>
On Fri, Aug 12, 2011 at 7:26 AM, Jay McCarthy wrote:
> 2011/8/11 Racket Noob :
>>
>> (define-syntax automaton
>> (syntax-rules (: -> END)
>> [(_ init-state
>> (state : transition ...)
>> ...)
>> (letrec ([curr-state empty]
>> [state
>> (lambd
2011/8/11 Racket Noob :
> Hi all!
>
> I want to create macro for creating a DFA automaton (similar to
> one described
> here: http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/paper.pdf )
>
> My desire is that, for example, this form
>
> (automaton init
> (init : (c ->
Hi all!
I want to create macro for creating a DFA automaton (similar to one described
here:
http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/paper.pdf
)
My desire is that, for example, this form
(automaton init
(init : (c -> more))
(more : (a -> more)
21 matches
Mail list logo