On 28/05/10 00:29, Jon Harper wrote:
> FUNCTOR: test1 ( NAME -- ) NAME IS ${NAME} WHERE TUPLE: NAME ; ;FUNCTOR
> does create the tuple, but not when the functor is parsed.
I know. The problem is that FUNCTOR: QList evaluates its contents
when it is parsed.
> From what I understand, the QList<T> word doesn't exist yet so you
> shouldn't use IS, but DEFINES.
QList<T> will exist when the functor is called. In code with the
unimportant bits elided:
FUNCTOR: QList ( T -- ) ... ;FUNCTOR
SYNTAX: QLIST: scan QList ;
CLASS: QPoint ;
CLASS: QList<QPoint> ;
QLIST: QPoint
This code barfs at line one because it tries to create QList<T> when
FUNCTOR: QList is defined; instead, it should create a QList<QPoint> at
the last line.
It's frustrating me no end because I just can't see what I'm missing.
> Good luck
Thanks :).
------------------------------------------------------------------------------
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk