[racket] Writing algebraic maths expressions
That just made me think of this:
https://github.com/AlexKnauth/sweet-exp-utils/blob/master/sweet-exp-utils/kw-let.rkt
Which lets you write:
kw-let #:a 1 #:b 2
{a + b}
Or:
kw-let
#:a 1
#:b 2
{a + b}
Instead of having let, group, and the first id-val pair all be on different lines.
On Mar 7, 2015, at 8:05 AM, Alexander D. Knauth <alexander at knauth.org> wrote:
>
> On Mar 7, 2015, at 7:11 AM, Norman Gray <norman at astro.gla.ac.uk> wrote:
>
>> Another possibility is Sweet expressions, as described at <http://pkg-build.racket-lang.org/doc/sweet/index.html> and <http://readable.sourceforge.net>. That feels plausible, but (i) the port doesn't seem complete, since when I try:
>>
>> #lang sweet-exp racket/base
>>
>> let
>> \\
>> a 1
>> *(a a)
>
>> (see <http://sourceforge.net/p/readable/wiki/Scheme-tutorial/>, at 'Grouping and Splitting'), I get 'let: bad syntax (not an identifier and expression for a binding) in: |\\|’.
>
> For this, sweet-exp uses `group` instead of `\\`.
>
> #lang sweet-exp racket
> let
> group
> a 1
> b 2
> {a + b}
>
>
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users