On Thu, 2006-11-16 at 22:10 -0800, Erick Tryzelaar wrote: > So what's the difference between these two? Felix doesn't seem to like > it if I do this: > > file1.flx: > #import <flx.flxh> > > val x = 1; > > > file2.flx: > #import <flx.flxh> > #import "file1.flx" > > print x; endl; > > > Of course, using "#include" works. So what is the difference? Is #import > essentially doing a textual inclusion, and #include just referencing the > file, which allows multiple references?
import imports preprocessor macros, that is #define .. #keyword .. #infix #bracket #statement #nonterm .. for a precise list see 'add_macros' in flx_lexer.ipk. Include doesn't import anything except code. The inclusion is that of token streams: > If this is the case, this > appears to be the opposite to what msvc has, where #import is a > reference, and #include textually includes the code. Hmm .. > Finally, would we gain back the '#' character if we just had "import" > and "include"? No need, it is already available and in use, just don't use it as the first character on a line .. :) Also don't use #!/ on the first line (that is skipped to allow Unix #!/usr/bin/env flx at the top of a file). > Finally finally, do we even need textual inclusion? > Something like that could be done with an external program. How often is > it used? It is there because C does it. We probably don't need it. It is possible there is a better way to grab #defines etc. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Felix-language mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/felix-language
