[self-interest] prototypes, "meta" and reflective programming
Jecel Assumpcao Jr
jecel at merlintec.com
Mon Jan 15 18:36:19 UTC 2001
On Fri, 12 Jan 2001, Dru Nelson wrote:
> C. Ramakrishnan wrote:
> > (|slot1 = foo. slot2 = bar| code)
> >
> > is a form of lightweight meta-programming?
I would call that "plain programming".
> what is meta-programming?
Well, my explanation in a previous message seems to have been too brief
so I'll try to be more detailed here.
"Meta" means "beyond", as in these three examples:
----
"Physics" is the study of the laws of the universe. It asks questions
like "if I let this object go, will it fall down or fly away?".
"Meta-physics" is the study of physics. It asks questions like "are the
laws we see in the universe the only possible ones? Are they random or
the product of an intelligent design?".
----
This list is for the discussion of the Self programming language. If we
start talking about the list itself, asking questions like "should a
simple reply go to the list or just to the author? Should we just
discuss Self or are Self-like languages ok?" then we can say that we
are having a "meta discussion".
----
Here is a bit of programming in Self:
failed: students copyFilteredBy: [ |:s| s grade < 5.0 ]
This program is *about* students and their grades. Now here is a bit of
meta-programming in Self:
enumerating all enumerate asList copyFilteredBy:
[ |:m| m isReflecteeMethod &&
[m sourceString asTextLines size == 10]]
This program is *about* a program - it finds the list of all methods in
the system that are exactly 10 lines long. Though this code looks very
much like the previous one, there is a subtle difference in that 's'
was an object and 'm' is a meta-object (a mirror). But there is
sometimes no difference at all in the tools used by programmers and
meta-programmers. In the example of a discussion and a meta-discussion
both used exactly the same tool: English.
-- Jecel
More information about the Self-interest
mailing list