tern-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

returning, focusing, on core task. Re: [tern] even more notes


From: david nicol
Subject: returning, focusing, on core task. Re: [tern] even more notes
Date: 09 Dec 2002 14:25:00 -0600


On Sat, 2002-12-07 at 14:42, Luke Palmer wrote:

> I think "means" is good.



Okay, "means" it is then.  Passed without objection.  (bangs gavel.)


Our narrow task is to define a macro langauge for use within perl,
to be implemented through the medium of a source filter, possibly
leveraging b::deparse to normalize the input code before applying
transformations.  so we can defer the challenges of parsing anything
other than pre-chewed B::Deparse output to a later phase.


Towards this end we need to come up with a list of primitives that
we can use, such as EXPR and BLOCK and BAREWORD and so on; based
on the terms used in the communications of posters to perl6-language.

TERN becomes a preprocessor:  any TERN line, which is a line of code
(outside of a literal) that contains the bareword "means" is a TERN
line; (where is my english?)  and there are several things TERN lines
can do:

        * define a grouping

        * tag a grouping

        * match and rewrite

Question:  do we need to add an explicit conditional to TERN or
do we rely on tagging for all logic?  With two tagging operators,
dash which means has this tag and bang which means does not have this
tag we can have fine-grained logic, and also remove tags.  A TERN
line to remove all "a" tags from any entity with a "b" tag would be

        ENTITY e-b means e!a

maybe it would be better to use + and - then, for gets-tag and
loses-tag

        ENTITY e+b means e-a



Tagging is for things like recognizing that a scalar variable is only
ever used in math contexts and therefore the checking and conversion
functions can be dropped early.

        # using + for "has tag" and - for "does not have tag"
        SCALAR s-stringifies means s+optimize_as_number

is that clearer than

        SCALAR s!stringifies means s-optimize_as_number


And open questions include at which point,e xactly, do we apply
things like this; also how to group rules.  I like the word "ruleset"
because it is what we called the sets of rules while playing Agora
Nomic; so that could make for another TERN primitive,

        ruleset NAME

you mark the end of your ruleset by declaring the empty ruleset again
rather than having yet another keyword to mark the end.

then we get another keyword "apply" that can be triggered on the
right side of a means.

        PHASE p+INIT means apply optimizizations


Yes, this is still very scattered.


-- 
David Nicol, independent consultant and contractor            312 587 2868
God did not create the world in seven days; he screwed around for six days
                           and then pulled an all-nighter. -- `fortune -s`





reply via email to

[Prev in Thread] Current Thread [Next in Thread]