bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Empty arguments


From: Colin Verrilli
Subject: Empty arguments
Date: Sat, 2 May 2020 20:13:17 -0400

I was playing around with using empty arguments with functions to see what happens.
This one seems to make sense

      ↑ (0↑(1 2)(3 4)),¨(0↑(1 2 3)(4 5 6))
0 0 0 0 0

This next one I'm not sure about. Theoretically, it should give the same result as above, but maybe the behavior is different for defined functions.
      ↑ (0↑(1 2)(3 4))f¨(0↑(1 2 3)(4 5 6))
0 0 0
      ⎕cr 'f'
z←l f r
z←l,r 

The APL2 LRM makes a big deal about each function having a corresponding "fill function" that is used when the arguments are empty. It's not clear about what happens with defined functions. 


This one should probably be a length error or something, but I get a failure.

      ↑ (0↑(1 2)(3 4))=¨(0↑(1 2 3)(4 5 6))

==============================================================================
Assertion failed: A->same_shape(*B)
in Function:      eval_fill_AB
in file:          ScalarFunction.cc:707

Call stack:

----------------------------------------
-- Stack trace at ScalarFunction.cc:707
----------------------------------------
0x43195865 __libc_start_main
0x80973E0  main
0x8200B65   Workspace::immediate_execution(bool)
0x80F1A4D    Command::process_line()
0x80F149E     Command::do_APL_expression(UCS_string&)
0x80F0C25      Command::finish_context()
0x80FAB54       Executable::execute_body() const
0x81B10DD        StateIndicator::run()
0x812CD9C         Prefix::reduce_statements()
0x812C31E          Prefix::reduce_A_F_B_()
0x8101FCC           DerivedFunction::eval_AB(Value_P, Value_P)
0x80C5B26            Bif_OPER1_EACH::eval_ALB(Value_P, Token&, Value_P)
0x81A2ACC             ScalarFunction::eval_fill_AB(Value_P, Value_P)
0x80AC487              do_Assert(char const*, char const*, char const*, int)
========================================

Colin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]