MetaPython 0.2.1 Release

0 views
Skip to first unread message

Rick Copeland

unread,
Apr 30, 2009, 11:16:15 AM4/30/09
to metapython
MetaPython 0.2.1 has been released with hygenic macros. This works by
adding some syntax to defcode: blocks. Now defcode looks a lot more
like a function definition:

defcode result(): ...

By default, all names in the block are sanitized. If you want to NOT
sanitize something, just list it as an argument to the block. For
instance, this:

defcode result(a, ?b):
$a = 5
b = 6
c = 8

expands to this (or something very similar), assuming the name 'a'
resolves to 'foo':

foo = 5
b = 6
_mpy_0 = 8

Enjoy!
Reply all
Reply to author
Forward
0 new messages