2 ms·
> console "foo" print Sorry if I misunderstand -- Wouldn't this send "foo" to the console object (which it probably wouldn't understand), and then send "print"
by thelazydogsback 7y ago
> console "foo" print
Sorry if I misunderstand -- Wouldn't this send "foo" to the console object (which it probably wouldn't understand), and then send "print" to whatever that returned, which isn't what you want? You don't want to send "print" to "foo" first and then send that to the console either. You want to send the message [print "foo"] to the console object - you are delegating the action.
[Using ST syntax] If you wanted to do it w/o a reified message, you could do:
console print "foo"
Where "print" is really "get-default-printer-object" which uses something like doesNotUnderstand to respond to "foo" as a message, or
console print: "foo"
As a keyword send, or to combine the approaches somewhat:
(console stdio-printer) print: "foo".
I will RTFM again so I can get a better handle on the Potion syntax - unlike ST which I'm more used to, it's not as clear to me yet at first glance what is a msg and what is an arg.