[q-lang-users] Improper tuples and user-defined operators
Brought to you by:
agraef
From: John C. <co...@cc...> - 2006-06-20 23:22:59
|
Albert Graef scripsit: > "Improper" tuples are vital in symbolic computations, e.g., you will > often find them as a pattern in lambdas or "case" constructs. Redefining > this syntax to something else would thus not only raise orthogonality > concerns, it would also kill Q's reflective capabilities. Ah, quite so. I wasn't thinking about patterns, where improper tuples are clearly useful. It still leaves me with the problem of how to map them to Scheme, however. Probably as a list whose first element is "q-tuple". Another point: it would be useful to me to have a qint.h function that reports which symbols are operators and which are not, so that when the Scheme user writes "(q-call over 1 2)" I can pass the symbol "(over)" rather than "over" to the qmkapp() function. Probably the Right Thing is to return the precedence level, for the benefit of someone trying to reconstruct the infix representation, or 0 if the symbol is not an operator. -- John Cowan co...@cc... http://ccil.org/~cowan "The exception proves the rule." Dimbulbs think: "Your counterexample proves my theory." Latin students think "'Probat' means 'tests': the exception puts the rule to the proof." But legal historians know it means "Evidence for an exception is evidence of the existence of a rule in cases not excepted from." |