GROUP!-headed Dispatch Of Functions Via WORD! (?)

If we want to use a GROUP! to assign a variable, we do that via the variable's "name", e.g. a bound WORD!:

But I noticed that to do a function, you have to do it by value of the function:

And if GROUP!-headed non-trivial chains are to be allowed, that seems it should work. (Maybe they shouldn't be allowed, and you should use APPLY?)

But if they're allowed, is there a good reason not to allow it by name in that case, as well?

>> fname: $append

>> (fname):dup [a b c] [d e] 2
== [a b c [d e] [d e]]

I actually tried that first, and it didn't work.

Answering this question is perhaps a general question of "do non-trivial CHAIN!s have meanings outside of functions in the default evaluator".

>> str: "Some string"

>> str:foo
== ???  ; always an error?  Or might str:foo mean something?

I was toying with that idea a bit at one point, like if str:length might be a shorthand for length of str.

But I'm leaning that with the idea of dialected function calls, the concept that you can take for granted that what you're looking at is a function interpreting a chain of information seems pretty important.

If that's the case, I don't know that I see much harm in allowing functions by variable name. But it's not a high priority, just thought I'd mention it in its own thread vs. a tangent at the end of another one.

1 Like