call - pannous/warp GitHub Wiki

Function calls in Angle are really a matter of pattern matching. Bad idea? Function calls in Angle are Julia style: they belong to all arguments. => should the 'self'/'this' keyword apply to the first argument?

Calls without parentheses

A word takes the values after it, nested words the result of the next; a minus before a call negates it:

sin cos 0      // sin(cos(0))
max 3 4        // 4, as max(3, 4) and max 3, 4
-sin 0         // -(sin 0)

The same call form works as the one statement of a control-flow block:

if yes { sum [1 2] } // 3

Gap Feeding of missing arguments with locals

# not yet: parameters fed from same-named locals (card gap-feeding)
to integrate a function from a to b ...
from = 1
to = 2
integrate sin  # feeds locals as arguments

Bad idea?

dynamic calls

Todo Currently Angle is a compiled language. The (optional!) runtime does contain an interpreter (lacking in implementation) sharing the same parse -> analyze pipeline. All dynamic calls should probably be passed through that eval mechanism.

getstatic java/lang/System/out Ljava/io/PrintStream;
invokevirtual java/io/PrintStream/println(F)V