Let's say I wanted to define an alternative syntax for some constructs 
like, for example,
"debut; ... ; fin" as an alternative syntax for "begin; ... ; end" blocks 
or "<-" as an alternative form for the assignment "=".   The first one 
would be easy to do with CPP and the second one with a tool like  perl or 
sed. Could such substitutions also be done with a Julia macro that would 
act on the content of an entire file so that the code containing the 
alternative syntax would first be parsed and each occurence of "<-" would 
be replaced with an "=" and "debut; ... ; fin" blocks woulld be replaced 
with "begin; ... ; end" blocks?

Another related question is could a Julia macro be written to mimic object 
oriented call syntax so that one could write. "a->f(b)" or "a.f(b)" as an 
alternative for "f(a, b) "?
I apologize in advance for the triviality of my question.  I have less than 
a week of Julia experience.


Reply via email to