jbee / panda

A early draft for a template rendering notation defined inside the template itself.
1 stars 0 forks source link

Pseudo-Selectors #6

Open jbee opened 12 years ago

jbee commented 12 years ago

How to support a couple of pseudo-selectors that are available for each Functor that doesn't have a connection to the value the Functor represents (like getting information upon the Functor itself - e.g. its class or so).

jbee commented 12 years ago

One possibility is to create a special Functor for that purpose. The original invoked functor will pass itself as an argument to this special functor. Thereby he can tell a lot about it. But one important case is missing: it cannot tell about the internal data/value of the argument functor. That's up to each functor.

jbee commented 12 years ago

There should be a special character indicating the invocation of pseudo values. It shouldn't be used in any other context or case. Because of that the possible characters are very restricted. Candidates: ^, >, $, ...?

jbee commented 12 years ago

In addition to selectors that can tell something about the current Functor associated with a Var or expression there should be support for selectors reading the execution state, the functor-stack (the evolution of the functors during invoking a Selector expression on a origin Functor.

jbee commented 12 years ago

Lets assume ^ is our pseudo functor indicator. Some ideas:

foobar^type = Integer(Functor) // the simple name of the functor class (maybe suppressing the word Functor)
foobar^stack = [Integer, String, Nothing] // stack is a list or object functor of stack frames