| There have been some threads relating to the proper interpretation of forms where the object in functional position is not a function. The goal being to give a sensible meaning to, for example, (10 x)
("thing" 'sym)
('foo 1/2) ; not that I can think of a sensible interpretation for this ...
Would it be useful for the interpreter, considering the object in functional-position, and finding it does not reference a function, to consider its type, and lookup a function based on that? In other words, automatically translating (10 x)
into something like (int-type-function 10 x)
While this seems interesting for primitive types (int, string, symbol etc), I am guessing this could bring extraordinary power to 'annotate. For example, (set current-user (annotate 'user (get-current-user))
(current-user 'disable)
results in (user-type-function current-user 'disable)
I agree that "int-type-function" is ugly and we could find a neater convention, but does the principle make sense? It seems to provide a way to make programs shorter and more readable at the same time. Or am I completely missing something? |