[tmcl-wg] CTM Templates and the prefix notation

Lars Heuer heuer at semagia.com
Wed Jun 27 09:51:19 EDT 2007


Hello TMCL'ers,

In Oslo you brought up the requirement that templates should be
invokable through prefix notation.

I.e.
     isa(mccartney, person)

but now we run in the CTM camp into troubles:

Within template invokations it is possible to define an explicit
variable binding, i.e.:

     plays-for(person: mccartney, group: The-Beatles, instrument: piano)

but this construct looks exactly like an association.

In infix notation this looks like:

   mccartney plays-for(The-Beatles, instrument: piano)

and is therefor easily distinguishable from an association.


My question: Is it absolutely necessary to (ab)use the templates and
to call them in prefix notation rather than in infix notation?

Maybe the new constructs

      *foo

and
      *

help to achive the same result?

The further creates a topic with a unique item identifier which is
reused if another reference to *foo occurs. The latter generates a
unique topic for every occurrence of "*".


     # *someone generates a new topic which is bound to "*someone"

     *someone plays-for(The-Beatles, instrument: piano)

     *somone isa person # Here we reuse the topic which was generated
                        # for *someone


Another point regarding templates: Templates should have at least two
variables to be callable in infix notation. If we do not need the
prefix notation, the following template would be invalid because it
contains just one variable

     def is-hidden($topic)
         hidden(hide: $topic)
     end


To make the story short: Any chance that you, TMCL'ers, switch to
template invokations in infix notation?

Best regards,
Lars
-- 
http://www.semagia.com



More information about the tmcl-wg mailing list