Re: About sweet-expression

2012-04-11 Thread Nala Ginrut
Sorry for very slowly updating. Because I have lot of interesting ideas to try. ;-) Now I added "syntax-error" which could catch the error token location and throw more details. For a instance: cut--- sweet@(guile-user)> #c While readi

Re: About sweet-expression

2012-03-12 Thread Nala Ginrut
I've noticed the mistake of my last mail. If we make curly-braces a delimiter, it's easier to read infix exp. And I think we may add an new option to read-options for curly-braces since there *is* an option for square-brackets. Considering such a patch for curly-braces could be delay applied. I thi

Re: About sweet-expression

2012-03-12 Thread Nala Ginrut
Thanks Mark! And another question: I think there isn't an easy way to use Guile inner reader directly. In simpler case, we can read the exp with it, say: {2 * 3 - 6} We may use inner reader to read the exp within {} or [] or () But the nested exp is not so easy: {2 * {3 - 6}} This CFG is easy to ha

Re: About sweet-expression

2012-03-12 Thread Mark H Weaver
Nala Ginrut writes: > On Tue, Mar 6, 2012 at 12:35 PM, Mark H Weaver wrote: >> Guile's reader is of no help at all with source properties. To clarify, the above quotation was taken out of context. I was only talking about one particular example, not making a general statement. >> Fortunately,

Re: About sweet-expression

2012-03-12 Thread Nala Ginrut
On Tue, Mar 6, 2012 at 12:35 PM, Mark H Weaver wrote: > Guile's reader is of no help at all with source properties. > Fortunately, Guile provides all of the interfaces you need to do this > job from Scheme: 'set-source-properties!', 'port-filename', 'port-line' > and 'port-column'. This will have

Re: About sweet-expression

2012-03-12 Thread Nala Ginrut
Sorry for the slow updating. But I think this pretty thing could be written as leisure. I added 'nfx', so the complex infix rocks: {1 + 2 - 5 / 4 * 3 + expt(2 3)} ==> 13/2 Enjoy!

Re: About sweet-expression

2012-03-06 Thread Nala Ginrut
On Tue, Mar 6, 2012 at 2:42 PM, David Kastrup wrote: > Nala Ginrut writes: > > > 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. > > >

Re: About sweet-expression

2012-03-05 Thread David Kastrup
Nala Ginrut writes: > 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'r

Re: About sweet-expression

2012-03-05 Thread Mark H Weaver
Nala Ginrut writes: > 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'r

Re: About sweet-expression

2012-03-05 Thread Nala Ginrut
sorry for stupid typo: s/Python of C/Python or C Regards

About sweet-expression

2012-03-05 Thread Nala Ginrut
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 ;-)).