Daniel ( dcu@aifh.ed.ac.uk not the prophet) writes:
> What is wrong with valof? How else am I supposed to create variable
> numbers of variables?
> I don't know if this is what it was intended to be used for, but I find
> it useful (maybe this reflects badly on my programming style? :-)
valof is a source of naughty aliasing. Thus if your model of good style
demands referential transparency, then it is wrong. Certainly, if I ever
get the theory of my type-checker to fly, it is most unlikely to include
valof. But then, if you wish to treat parametric polymorphism rigourously,
any kind of updater is also problematic.
However, I note that under the imprimatur of Uncle Rod Burstall in LIB
QUIZZING MACHINE, in the Silver Book, is to be found a use of valof.
So...personally I do make use of valof. E.g. in my -parse_gen-
parser-generator it is used to find the value of POP-11 identifiers alluded
to in operator declarations, and to find out if a non-terminal has been
defined. I use it in algebraic simplification, to evaluate terms like
2+3
All these things may be regarded as naughty - they certainly couple
sub-systems like the parser-generator perhaps too closely to POP-11,
thereby making a clear specification hard to write.
(Burstall, Collins and Popplestone[1971], "Programming in POP-2", Edinburgh
University Press)
Robin Popplestone.
|