Array literal syntax

Tony Garnock-Jones tonyg at lshift.net
Mon Dec 19 03:03:39 PST 2005


Brian Rice wrote:
> Smalltalk does #[] for that, but for us, that's compile-time evaluation
> of a block. Generally, we use #- prefix to denote compile-time evaluation.

How frequently is CTE used? Perhaps a single-char syntax for that is
overkill - mightn't `atCompileTime be better?

  {1. 'hi'. #something} `atCompileTime  "oh ok it's #used a lot. oops"

  {my complexComputation. another trickyComputation} `atCompileTime
  {my complexComputation. another trickyComputation} `preEvaluated

(Obviously, notions of phase and scoping rear their ugly heads...)

Actually this is interesting - the #something above is using '#' to mean
'quote' (roughly). To properly resolve this would require a proper
investigation into the nature of quoting and any relationship it has to
staged evaluation in Slate. Tricky stuff. I retract the suggestion for
now :-)

Tony




More information about the Slate mailing list