On Sun, 2007-11-25 at 18:24 -0800, Erick Tryzelaar wrote:
> We could probably remove the ability to do 1i.
> 
> What about just having a scoped syntax extension that allows you to
> write "1.0 + 1.0i" in the complex module that isn't automatically
> opened? For quaternions, you could add another that added support for
> 1.0j and 1.0k.

This is unlikely to work because it is a matter of lexicology not
syntax. I have looked at 'dynamically loadable' lexing as a possibility:
Felix itself already has the Ocaml code to generate a DFA which can
be interpreted, however there is still a problem of encoding the
tokens. Given how Dypgen works, it may be possible to make this
dynamic. However without dynamically loadable native code (perhaps
in Ocaml 3.11) it is all quite hard to organise (and perhaps even then).

Just to make it clear: lexing is done first in a pass on a file,
before any syntax analysis is done. That's why new tokens must
be introduced with #preprocessor directives, and are scoped to
the logical file (i.e. the physical file + #imports).

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to