Gave it a try:

     x←6
     y←⍳5
     (2=⎕nc'x') →→ x⍴y ←→ ⍴y ←←
1 2 3 4 5 1
     )erase x
     (2=⎕nc'x') →→ x⍴y ←→ ⍴y ←←
5
     tryit←{(2=⎕nc'x') →→ x⍴y ←→ ⍴y ←←}


===================================================
SEGMENTATION FAULT
*** useless apl.lines (no CXXFLAGS=-rdynamic -gdwarf-2)

----------------------------------------
-- Stack trace at main.cc:102
----------------------------------------
0x7fd5887171e2 __libc_start_main
0x485c8a  main
0x63dd25   Workspace::immediate_execution(bool)
0x4ef575    Command::process_line()
0x4efbe1     Command::finish_context()
0x4fc307      Executable::execute_body() const
0x5cd5c0       StateIndicator::run()
0x53bb21        Prefix::reduce_statements()
0x53b430         Prefix::push_END_error()
0x536636          Prefix::syntax_error(char const*)
0x4fc0a1           throw_apl_error(ErrorCode, char const*)
0x4fbe3f            Error::update_error_info(StateIndicator*)
0x500770             Executable::set_error_info(Error&, Function_PC2) const
0x7fd588cfd1b0
0x48b0b7
========================================
========================================
====================================================


Probably not worth trying to fix this--it's too obscure.



[3] ~tinkering/apl/mtx/src >




On 10/23/24 12:30, Dr. Jürgen Sauermann wrote:
Hi Hendrik,

as far as I remember: in GNU APL a lambda is pretty much a regular defined function. A nomadic lambda is simply a dyadic lambda which test for the presence for its left argument (read: ⎕NC lambda = 2).Tour tryit needs to check that before ⍺ is referenced).

Best Regards,
Jürgen


On 10/23/24 16:55, Henrik Moller wrote:
To all APLers:  In GNU APL, is there any way to define an ambivalent lambda?  I.e., if you define a lambda

    tryit←{...}

is there any way to make it work with both

    tryit 1

and

    1 tryit 2

The Net has been unhelpful...

Thanks

Reply via email to