[racket] formlets and . => .
Actually, it's special syntax for infix operators, regardless of how
many arguments they have. For instance, when writing contracts,
prefix notation looks like this:
(-> integer? integer? boolean?)
...while infix notation looks like this:
(integer? integer? . -> . boolean?)
Equivalently, you could write this, although with contracts it
wouldn't make as much sense:
(integer? . -> . integer? boolean?)
Whatever single s-expression is between the two periods gets moved to
the front of the list by the reader.
I don't know what => means in formlets.
Carl Eastlund
On Thu, Nov 17, 2011 at 4:38 PM, Grant Rettke <grettke at acm.org> wrote:
> The dual dot is a special syntax for things with two arguments.
>
> Eg:
>
> (1 . + . 3)
>
> (4 . / . 2)
>
> On Thu, Nov 17, 2011 at 3:26 PM, Jordan Schatz <jordan at noionlabs.com> wrote:
>> What does => mean? I see it used in formlets:
>> From http://docs.racket-lang.org/web-server/formlets.html?q=formlets
>>
>> like:
>>
>> (define date-formlet
>> (formlet
>> (div "Month:" ,{input-int . => . month}
>> "Day:" ,{input-int . => . day})
>> (list month day)))
>>
>> Which I think should be and appears to be equal to:
>>
>> (define date-formlet
>> (formlet
>> (div "Month:" ,{=> input-int month}
>> "Day:" ,{=> input-int day})
>> (list month day)))
>>
>> But what does the => do? Is it a form of apply?
>>
>> Thanks,
>> Jordan
>> _________________________________________________
>> For list-related administrative tasks:
>> http://lists.racket-lang.org/listinfo/users
>>
>
>
>
> --
> http://www.wisdomandwonder.com/
> ACM, AMA, COG, IEEE