bug-apl
[Top][All Lists]
Advanced

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

Re: Stack trace QuadCR space


From: Hans-Peter Sorge
Subject: Re: Stack trace QuadCR space
Date: Sat, 15 Feb 2025 19:19:20 +0100
User-agent: Mozilla Thunderbird

Hi Jürgen,

thank you.
Fixed with SVN 1838.

for info apl :
Chapter 1 [ENTER] is OK
Menu and Chapter 2 .. 7  [ENTER] no reaction.

for ⎕MX there is no help.

I agree, that in the context  with  ⎕FIO, ⎕CR, ⎕MX, ⎕FFT, ⎕RVAL and others
my proposal would not be helpful.

I there a way to redirect any  file descriptor ( &1 .. &n ) into a variable with an apl command?
Like  'VAR'  ⎕FD n ?  (Redirect FD n to VAR)  
and  ⎕FD n  ←→  redirect FD n to session.

This would solve the more general case (and my case) too where intermediate output is being
sent to stderr / stdout,  keeping it from printing into the session.

Best Regards
Hans-Peter

Am 15.02.25 um 16:54 schrieb Dr. Jürgen Sauermann:
Hi Hans-Peter,

I believe that I have fixed the first Assertion below (even if I
could not reproduce it on my box). SVN 1838.

Many built-in functions return 0 0⍴0 because that is (the only ?)
APL value that does not emit a \n when being printed (in many
cases unintentionally).

Also, several ⎕-functions (i.e. ⎕FIO, ⎕CR, ⎕MX, ⎕FFT, ⎕RVAL) use the
convention that monadic argument ⍬ prints a list of sub-functions
(sorted by sub-function number), while monadic argument '' prints
a list of equivalent syntaces (sorted by sub-function name).

As a matter of consistency I would like to keep this convention rather
than changing it for ⎕CR alone. This id also documented in info apl
chapter 2.3.4 Subfunction Lists. IOW it is a GNU APL feature.

Best Regards,
Jürgen


On 2/14/25 14:55, Hans-Peter Sorge wrote:
Hi,


     )clear  
CLEAR WS
     ⎕CR ' '

==============================================================================
Assertion failed: size()
in Function:      back
in file:          UCS_string.hh:322

C/C++ call stack:

----------------------------------------
-- Stack trace at Assert.cc:75
----------------------------------------
0x7f144d52a30b __libc_start_main
0x7f144d52a248   
0x403e50   main
0x5d7117    Workspace::immediate_execution(bool)
0x45eeb7     Command::process_line()
0x45f112      Command::process_line(UCS_string&, std::ostream*)
0x46172a       Command::do_APL_expression(UCS_string&)
0x461a1e        Command::finish_context()
0x48a2f7         Executable::execute_body() const
0x56ecee          StateIndicator::run()
0x4c6817           Prefix::reduce_statements()
0x4c7777            Prefix::reduce_MISC_F_B_()
0x4fbd87             Quad_CR::eval_B(Value_P) const
0x4fbde9              Quad_CR::do_eval_B(Value const*, bool)
0x476ab6               UCS_string::back()
0x4226d1                do_Assert(char const*, char const*, char const*, int)
========================================
========================================

SI stack:

Depth:      0
Exec:       0x37523420
Safe exec:  0
Pmode:      ◊  ⎕CR ' '
PC:         3 (4) RETURN_STATS
Stat:       ⎕CR ' '
err_code:   0x0


============================================================================== 


With non exiting names the result is an empty matrix:
   ⍴⎕CR 'A' 
0 0

Then:
   ⎕CR '' or
⎕CR ⍬
prints help info.

This is a bit "overloaded':

What happens is:
The assignment
     bodies ← ⎕CR¨ 'Name1' '' 'Name2'
will print the help and 
     ⍴¨ bodies
returns like
  (n m)  0  (n m)




Further more:
The three cases have the following results:
1:
0 0 ←→ ⍴
⎕CR 'none_exiting_name'

and
2:
0 0 ←→
⎕CR 'invalid_name'

the "special case"
3:
STACK TRACE ←→
⎕CR '    '


for 2: and 3: i propose for the output to result in ⍬:
⍬ ←→ ⎕CR 'invalid_name'

and change of
⎕CR ''  or  ⎕CR ⍬ to
'' ⎕CR ''  or '' ⎕CR ⍬  to suppress terminal output.


Best Regards
Hans-Peter



reply via email to

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