Re: Re: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-14 Thread Jens Axel Søgaard
Yes, lambda expression have an implicit begin in the body. > (begin . (1 2 3)) 3 > (begin (1 2 3)) application: not a procedure; expected a procedure that can be applied to arguments given: 1 arguments...: Here (begin . (1 2 3)) is the same as (begin 1 2 3). The

Re: Re: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-14 Thread Pedro Caldeira
Does that mean that lambda expressions have an implicit (begin …) block in them? (begin ((displayln 1) (displayln 2) (displayln 3))) leads to an error (begin . ((displayln 1) (displayln 2) (displayln 3))) displays to 1 2 3 Thank you for the detailed explanation I think I get it now. > On 13

Re: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-13 Thread Pedro Caldeira
>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

Re: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-13 Thread Jens Axel Søgaard
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

RE: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-13 Thread Jos Koot
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)

Re: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-13 Thread Matthias Felleisen
> 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