Metaprogramming: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 22: | Line 22: | ||
J's [http://www.jsoftware.com/help/dictionary/d310n.htm explicit definitions] might also be considered an example of metaprogramming, since explicit definitions have data dependent syntactic types. |
J's [http://www.jsoftware.com/help/dictionary/d310n.htm explicit definitions] might also be considered an example of metaprogramming, since explicit definitions have data dependent syntactic types. |
||
=={{header|Lua}}== |
|||
Due to the way Lua's syntactic sugar is designed, metatables can make some Lua code look like a Domain-Specific Language, despite technically being (mostly) just specialized operator overloading. |
|||
For example: |
|||
<lang lua> |
|||
class "foo" : inherits "bar" |
|||
{ |
|||
} |
|||
</lang> |
|||
is perfectly valid syntax despite Lua not having a built in concept of classes or inheritance. |
|||
=={{header|Perl}}== |
=={{header|Perl}}== |