in reply to Re^5: hrm, Eval::Compile
in thread hrm, Eval::Compile
Even though foo() isn't defined yet, perl recognizes it as a function yet to be defined by the syntax(like your tags), so it holds off reporting an error as long as possible (runtime, when it tries to call it)$ perl -c -e " foo(1); " -e syntax OK
$ perl -e " foo(1); " Undefined subroutine &main::foo called at -e line 1.
H.O.P is all about this approach, build a tree, walk the tree, modify the tree, compute
The computable things are defined by syntax < > [ ] ( ), whether they'll actually compute or be returned verbatim is delayed until runtime
Like perl, TT2 takes the approach that if its not computable, its an error, not a string substitution
Your blind spot seems to be your current implementation -- you keep thinking in terms of substitution s/// instead of function/method calls -- even s/// is not really substitutions, its a series of function/method calls -- each call to s/// is a walk of the tree (flat tree, a string)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: hrm, Eval::Compile
by Logicus (Initiate) on Jul 21, 2011 at 00:26 UTC | |
by Anonymous Monk on Jul 21, 2011 at 01:13 UTC | |
by Logicus (Initiate) on Jul 21, 2011 at 02:53 UTC |