|
From: | Panicz Maciej Godek |
Subject: | Re: Guile Assembler |
Date: | Tue, 23 Jun 2015 23:00:19 +0200 |
How is this syntax macro style improve on a more direct and simple
On 2015-06-23 17:19:56 +0800, Nala Ginrut wrote:
> On Tue, 2015-06-23 at 11:12 +0200, address@hidden wrote:
>> What does number/base do? Does it change the read syntax of numbers?
>>
>
> I think it defines a function (number/base base) first, then use it as
> argument of the outer function...
>
> http://docs.racket-lang.org/reference/define.html
>
standard scheme implementation of:
(define (number/base base)
(lambda (lst)
(let loop ((digits lst)
(accumulator 0))
(if (null? digits)
accumulator
(loop (cdr digits)
(+ (car digits) (* accumulator base)))))))
This amalgam of 'match' and 'define-syntax's style '...', and
'destructuring-bind' syntax just seems to add complexity to a language
whose prime benefit is the clarity of its explicitness and lack of
syntax.
[Prev in Thread] | Current Thread | [Next in Thread] |