For Programmers: Free Programming Magazines  


Home > Archive > Scheme > May 2005 > Re: swiss army knife









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: swiss army knife
Joe Marshall

2005-05-04, 4:00 pm

Anton van Straaten <anton@appsolutions.com> writes:

> Joe Marshall wrote:
>
> Here lies the ultimate solution: Scheme code should be authored in a
> specially-designed SGML dialect. We can use HTML to prototype this to
> get a feel for the many advantages of the approach, e.g.:
>
> (define <i>IncBeta</i> (λ (β) (+ β 1)))
> (<i>IncBeta</i> 41) ;=> 42
>
> As an additional benefit, this syntax may be more attractive to
> e.g. Perl programmers. It's hard to see a downside here!


It still has those damnable smooth parenthesis. I suggest replacing
the ones that do not surround function calls with curly braces:

{define <i>IncBeta</i> {λ {β} (+ β 1)}}
(<i>IncBeta</i> 41) ;=> 42

and possibly moving the function position to just before the parens
and adding a sprinkling of gratuitous other punctuation.

{define <i>IncBeta</i> {λ {β} + (β, 1);}}
<i>IncBeta</i> (41) ;=> 42

There we go. Isn't that *much* more readable? I bet it runs a lot
faster, now, too.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com