[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
About sweet-expression
From: |
Nala Ginrut |
Subject: |
About sweet-expression |
Date: |
Tue, 6 Mar 2012 11:21:11 +0800 |
I try to port sweet-_expression_ to newest Guile. Fortunately, the author wrote a compatible version for old Guile in 2008. So I just try to rewrite part of it for some obvious reasons. It woks fine now.Though some guys doesn't like sweet-_expression_ at all (OK, they're real Lispers! But me too ;-)). I'm not a big fan to write Scheme like this:
-----------------------
define fibfast(n)
if {n < 2}
n
fibup(n 2 1 0)
-----------------------
But I think it maybe useful for newbies especially came from Python of C. If we can fix the problems which I'll mention later, I expect it to be added as inner language support.
I put it here, if you're interested, please checkout here:
It supports Modern & Sugar both. You may read the README and try the example.
But there're some problems for the original implementation, so I didn't format a patch. I think there should be something to be fixed.
1. The author's comment shows that we don't need to re-implement a reader if our reader treats "[]" and "{}" as delimiter. But seems "{}" is not delimiter in current Guile. Mark Weaver said it should be fixed.
2. And the second suggestion of Mark Weaver is we *must* try the Guile inner reader tools and keep some information if there's errors happened. I think it's a more worthy consideration. The current sweet is too weak to be a productive thing.
3. We don't have "nfx" macro in current Guile, so only simple infix _expression_ can be evaluated. Say, all the operators are homologous:
{1 + 2 + 3} is simple infix _expression_
{1 + 2 - 3} is not.
Anyway, it's not a big deal, I'll fix it later. But I'm not sure whether it should be in Guile or in app? Since the author use "nfx" directly, maybe it's a common thing we missed?
- About sweet-expression,
Nala Ginrut <=
Re: About sweet-expression, David Kastrup, 2012/03/06