[racket] Re-usable C-like input syntax
On 05/21/2013 02:45 PM, David Bremner wrote:
> Tom Schouten <tom at zwizwa.be> writes:
>
>> Interesting, but I'm tied to Racket at this point.
>>
> I'd have a look at "Honu" by Jon Rafkind if you haven't seen it
> already. It adds an algol like syntax on top of racket,
>
> It looks a bit javascriptish, I guess
>
>
> function quadratic(a, b, c) {
> var discriminant = sqr(b) - 4 * a * c
> if (discriminant < 0) {
> []
> } else if (discriminant == 0) {
> [-b / (2 * a)]
> } else {
> [-b / (2 * a), b / (2 * a)]
> }
> }
[(-b + discriminant) / (2 *a), (-b - discriminant) / (2 * a)]
I know the paper is wrong.. :(