[squeak-dev] String >> #numArgs

Tobias Pape Das.Linux at gmx.de
Sun Dec 15 11:24:32 UTC 2019


> On 14.12.2019, at 21:11, Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
> 
> Hi all!
> 
> Consider the following:
> 
> foo := [:a :b | a raisedTo: b].
> bar := #raisedTo:.
> 
> foo value: 2 value: 3. "5"
> bar value: 2 value: 3. "5"
> 
> foo numArgs. "2"
> bar numArgs. "1"
> 
> How can I overcome this inconsistency?

There is none.
Symbols are not code.

I see no point beyond apparent convenience to unify them further....
-t

> In situations where a symbol acts as "evaluable", quaking like a block, it is confusing to get these different results
> Does there already exist a unified protocol? Or am I doing something wrong in general when I need this?
> 
> Best,
> Christoph




More information about the Squeak-dev mailing list