Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-25 Thread skaller
On Fri, 2007-05-25 at 11:34 -0700, Erick Tryzelaar wrote: > Oh sorry, you're right. That should be: > > #syntax light > > whilst x do > x = 1 > y = 2 > > #endsyntax You can do this now: while { x } $$ x = 1 y = 2 ; because that uses a the

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-25 Thread skaller
On Fri, 2007-05-25 at 17:39 +, Martin Percossi wrote: > Erick Tryzelaar wrote: > > #syntax light > > whilst x do > >x = 1 > >y = 2 > > done > > #endsyntax > > I don't like this because users will forget about the one on the bottom, > if, as I suspect they will, they surround the en

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-25 Thread skaller
On Fri, 2007-05-25 at 10:24 -0700, Erick Tryzelaar wrote: > We talked about this when skaller implemented "$$". I believe his reason > against "#syntax light" was that it was a global declaration, and he'd > prefer not to have them. This is not quite the case: the first step is to get somethin

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-25 Thread Erick Tryzelaar
Martin Percossi wrote: > Erick Tryzelaar wrote: > >> #syntax light >> whilst x do >>x = 1 >>y = 2 >> done >> #endsyntax > > I don't like this because users will forget about the one on the bottom, > if, as I suspect they will, they surround the entire file with the > directives. Also, w

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-25 Thread Martin Percossi
Erick Tryzelaar wrote: > We talked about this when skaller implemented "$$". I believe his > reason against "#syntax light" was that it was a global declaration, > and he'd prefer not to have them. I think it may also complicate the > lexer. One alternative idea (that I never mentioned) I did h

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-25 Thread Erick Tryzelaar
Martin Percossi wrote: >> Optional indentation has just been implemented, but it requires >> an introduction: >> >> whilst x do $$ >> x = 1 >> y = 2 >> >> This integrates fairly seamlessly with free form, without >> any special knowledge of the syntax. I'm not sure I

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-25 Thread Martin Percossi
skaller wrote: >What do you mean I can't inline? Felix inlines almost everything, >inlining is its primary optimisation technique. > > I mean you can't write whilst x do #syntax light x = 1 y = 2 Sorry, I overloaded the word inline there! Cheers, Martin

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-25 Thread skaller
On Fri, 2007-05-25 at 16:37 +, Martin Percossi wrote: > skaller wrote: > You are of course completely right. Come to think of it, I remember a > discussion about this on haskell list. Must be getting senile in my old > age ;-) Cool .. I was senile in my youth .. :) > >Note also, Felix uses

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-25 Thread Martin Percossi
skaller wrote: >>Another cool thing: the use of backquotes to get infix notation. 5 `mod` >>2 is just very nice in my opinion. >> >> > >Actually it sucks because backquotes can't be nested without >gratuitous brackets > > You are of course completely right. Come to think of it, I remember

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-24 Thread skaller
On Thu, 2007-05-24 at 15:27 +, Martin Percossi wrote: > Hello felix-list, > > I think it would be a good idea to try to shamelessly steal syntax ideas > from haskell. hehe .. already being done :) > I think that haskell's syntax, and typeclasses, are its > best features -- and you've alr

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-24 Thread Martin Percossi
Hello felix-list, I think it would be a good idea to try to shamelessly steal syntax ideas from haskell. I think that haskell's syntax, and typeclasses, are its best features -- and you've already got the latter! There would obviously have to be some changes, because haskell, as a pure languag

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-18 Thread Ben Smith
On 18/05/07, skaller <[EMAIL PROTECTED]> wrote: > On Fri, 2007-05-18 at 11:17 +0100, Ben Smith wrote: > > > I like the postfix form in Magma: eg > > k := NumberField(u^2 + u + 2) where u is PolynomialRing(QQ).1; > > Speaking of Magma .. it's all C code isn't it? > I wonder how a Felix binding to Ma

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-18 Thread skaller
On Fri, 2007-05-18 at 11:17 +0100, Ben Smith wrote: > I like the postfix form in Magma: eg > k := NumberField(u^2 + u + 2) where u is PolynomialRing(QQ).1; Speaking of Magma .. it's all C code isn't it? I wonder how a Felix binding to Magma would look? I think the point here is people, particula

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-18 Thread skaller
On Fri, 2007-05-18 at 11:35 +0200, Rhythmic Fistman wrote: > > Message: 4 > > Date: Thu, 17 May 2007 17:44:08 +1000 > > From: skaller <[EMAIL PROTECTED]> > > I want to begin discussion how we should make the new grammar > > and extension system look, so please comment! Vent your > > pet hates and c

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-18 Thread skaller
On Fri, 2007-05-18 at 02:31 -0700, Erick Tryzelaar wrote: > skaller wrote: > > I think it is important to note that 'recognizable' symbols > > will be domain specific. A mathematician will demand different > > symbols to an economist. > > > > This is what fortress does: > > http://research.sun

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-18 Thread skaller
On Fri, 2007-05-18 at 02:13 -0700, Erick Tryzelaar wrote: > skaller wrote: > Are you looking for tweaks to the grammar that can parse the same > syntax, or are you also considering changing the syntax and semantics to > make things simpler? Refactoring: that's a complete rewrite, without gratui

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-18 Thread Ben Smith
On 17/05/07, skaller <[EMAIL PROTECTED]> wrote: > Part 2 .. Notes on the Grammar > ** > B. Expression grammar is basically 4 forms: > > prefixop expr > expr postfixop > expr infixop expr > atom > > In this formulation, atom or operator can be compound, > for exam

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-18 Thread Rhythmic Fistman
> Message: 4 > Date: Thu, 17 May 2007 17:44:08 +1000 > From: skaller <[EMAIL PROTECTED]> > I want to begin discussion how we should make the new grammar > and extension system look, so please comment! Vent your > pet hates and complaints, make constructive and useless > suggestions, be prepared for

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-18 Thread Erick Tryzelaar
skaller wrote: > The actual operator can be a keyword of any sequence of > special characters. Felix uses a longest match algorithm > to lex sequences of special characters. > > To be modern, we might consider Unicode symbols. However, > most of them are actually useless ;( > > Even the APL subset

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-18 Thread Erick Tryzelaar
skaller wrote: > Part 0: Introduction. > * > > Felix has a rather complex expression grammar. It has a limited ability > to add new infix operators of a fixed precedence (although the > preprocessor directive appears to permit a choice of precedence level). > > Now we have the e

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-17 Thread skaller
Part 4. Characters and Symbols *** It is unfortunate we have to deal with ASCII character set, since it lacks many symbols. In Felix we have magic associations: fun add: int * int -> int; val x = 1 + 2; // + is add .. New infix operators can be defined by: #inf

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-17 Thread skaller
Part 3: what everyone knows I think everyone 'knows' this ordering: logic: or and not comparison: < > <= >= <> != == arithmetic: add + - mult * / exponent ^ naming: . There's some confusion over distribution of unary - over exponentiation, and it

Re: [Felix-language] Fixing the Felix expression Grammar

2007-05-17 Thread skaller
Part 2 .. Notes on the Grammar ** A. Please see: http://code.felix-lang.org/wiki/Expressions for another summary of expressions. B. Expression grammar is basically 4 forms: prefixop expr expr postfixop expr infixop expr atom In this formulation, atom or ope

[Felix-language] Fixing the Felix expression Grammar

2007-05-17 Thread skaller
Part 0: Introduction. * Felix has a rather complex expression grammar. It has a limited ability to add new infix operators of a fixed precedence (although the preprocessor directive appears to permit a choice of precedence level). Now we have the extensible GLR parser availabl