Monadics versus Dyadics in ::SHE+ILA::

Elegant Woman in Purple Velvet Gown in Luxurious Setting
83
0
  • Squishy Plushie's avatar Artist
    Squishy Pl...
  • Prompt
    Read prompt
  • DDG Model
    DaVinci2
  • Access
    Public
  • Created
    19h ago
  • Try

More about Monadics versus Dyadics in ::SHE+ILA::

Suppose we have the expression "hello squishy wishy woo;". Now the parser doesn't know (without looking at the code behind the objects "hello", "squishy", "wishy", and "woo") whether each is a value, a monadic function, or a dyadic (taking a parameter on each side) function. One scenario is we call "woo" which returns a result, we then pass it (on the stack) to "wishy", which turns out to be dyadic. So now we have to evaluate "squishy" before can call "wishy". APL gets round this by parsing from right-to-left, and keeping a table of function headers in RAM to make it efficient to check whether an object is a value, a monadic function, or a dyadic function. But we have chosen to be more Pascal -like, so we can call functions without supplying parameters (meaning that we have to use "&" if we want to mention them without calling them). Bleh :) Anyway, having the parser perfoming a swan-lake ballet around our code expression would slow down ::ILA:: too much, so we have decided to put Dyadic functions in their own namespace (for example APL's RHO function becomes "#" (length) and "$#" (reshape) ) Well done Ken Iverson for managing to fit it all in your system, but I've "cheated" by creating more special symbols instead. And there are no user-defined dyadics, just use a monadic with an array as a parameter, as you would in most other languages ("#%", i.e. "length of parameter" will tell you how many parameters were passed in.) See, even ::SHE+ILA:: is only holding one glass, so the AI has already sussed it :)

Comments


Loading Dream Comments...

Discover more dreams from this artist