I have recently started on working on a new language. This isn't a
academic project, or a corporate endevor. Its more or less a project to
keep me happy with programming in a language I want to use.
I have had recent thoughts on the inclusion of macros.
The ideas running through my head so far is to treat functions
and macros the same on the definition side, but changing the way they
are invoked/used by the programmer.
Basically I am looking for the ability for every function to have
the capabilities of being treated like a macro.
a basic syntax (in no particular language) may look something like this:
define-function foo: x, y # define function 'foo', passing x and y as arguments
.....
foo: x, y # invoke function 'foo'.
@foo: x, y # invoke foo as a macro
I have been told by some others that my problem with lie within my use
of infix operators, and I may have a lot of the macro complexity problems
that Dylan has (which I am still doing research on).
I guess I wanted to do this to avoid, what I thought to be, fluffy
syntax (in reference to Scheme) with such functions as define, and
define-syntax. I wanted one way to define a group of expressions, and
then later on decide how I wanted those expressing to be evaluated...
hence the ability to invoke said procedure as a function, or a macro.
Any help provided by yourself or the LtU community, would be most
appreciated.
Best regards,
M.J. Stahl
|