On Sat, 12 Mar 2016 15:51:44 -0600,
Matthias Felleisen wrote:
>
> On Mar 12, 2016, at 1:22 PM, Jay McCarthy
> wrote:
>
>
> For my taste, I don't want to run any program on my files to "turn
> them into real Racket".
>
> I think you already are running programs on your Rack
If we use
(define-syntax define/memoized
(syntax-rules ()
((_ (name . args) . body)
(define name (memoize (lambda args body))
and body is bound to((displayln x) (displayln y) (displayz))
then
(lambda args body)
will become
(lambda ((displayln x) (displayln y) (dis
Sorry I've messed up my reply, here's the actual reply
>Imagine (_ (foo x y z) (displayln x) (displayln y) (displayln z)) as the
>actual syntax. The .body will be bound to the sequence of three diaplaylns and
>this sequence will become the body of the lambda in the expansion.
So in this case bod
>Imagine (_ (foo x y z) (displayln x) (displayln y) (displayln z)) as the
>actual syntax. The .body will be bound to the sequence of three diaplaylns and
>this sequence will become the body of the lambda in the expansion.
So in this case body will be bound to the list ((displayln x) (displayln y
The cons cell constructed by (cons 1 2)
is normally printed as (1 . 2).
The list created by (list 1 2 3) could also be created
as (cons 1 (cons 2 (cons 3 '(. It could be printed as
(1 . (2 . (3 . (.
Normally lists are simply printed as (1 2 3) though.
Notice that (1 . (list 2 3)) is the s
Consider (define/memoized (a b c d) form0 form1 form2)
. body allows the body to consist of more than one form.
Without the dot, syntax define/memoized would accept bodies of one form
only,
that is (define/memoized (a b c d) form0) would match, but
(define/memoized (a b c d) form0 form1 form2) woul
> On Mar 13, 2016, at 11:05 AM, Pedro Caldeira
> wrote:
>
> Hello everyone,
>
> Since I've discovered the concept of metaprogramming I've been quite
> interested in Racket and its syntax extension capabilities.
>
> While searching for a memoization syntax extension I found a macro whose
> p
Hello everyone,
Since I've discovered the concept of metaprogramming I've been quite interested
in Racket and its syntax extension capabilities.
While searching for a memoization syntax extension I found a macro whose
pattern extension remained unclear.
(define-syntax define/memoized
(syntax
8 matches
Mail list logo