bug-apl
[Top][All Lists]
Advanced

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

Re: APL lambda question


From: Henrik Moller
Subject: Re: APL lambda question
Date: Fri, 25 Oct 2024 09:17:11 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0

Re RTLD_LAZY, much appreciated.

Re ⎕NC, that's the advantage of some nut writing obscure code: it identifies obscure bugs.

Henrik

On 10/25/24 08:13, Dr. Jürgen Sauermann wrote:
Hi Henrik,

thanks for the reminder. Fixed in SVN 1783.

I also spotted an error which caused ⎕NC to return a wrong value for ⍺, ⍵, etc.
⍺ and ⍵ came after ⎕NC was first implemented, and I failed to handle them properly.
Note also that ⎕NC is slightly different from IBM's by having different values for
user defined and system defined names. Therefore ⍺ has a ⎕NC of 5 if defined.

For example:

      MINUS←{ (⍺-⍵)⊣⍎"0"⊢[5≠⎕NC'⍺']"⍺←0" }
      5 MINUS 1
4
      MINUS 1
¯1


Best Regards,
Jürgen


On 10/24/24 18:15, Henrik Moller wrote:
Hey, Jürgen,

Thanks. 

This is part of continuing work on the mtx native function thing I put up six months ago, and just for the sake of consistency, I was trying make all the mtx functions lambdas, but it's no problem to use a ∇ function when I need ambivalence.  (If I'd looked at how you implement lambdas and conditionals, I would have known the lambda approach wouldn't work...)

Speaking of mtx, per the note I sent you a couple days ago, have you had a chance to look into making the dlopen() in NativeFunction::try_one_file() use RTLD_LAZY instead of RTLD_NOW?  I don't think anyone but me is using mtx, so it's cool if LAZY isn't in your plans--it just means I patch the line when you put out a new SVN.

Thanks,
Henrik

On 10/24/24 11:30, Dr. Jürgen Sauermann wrote:
Hi Henrik,

I believe I fixed the Segfault. You should now get
a DEFN ERROR instead with )MORE information.
SVN 1782.

The reason is this:

1, Conditionals, i.e. COND →→ IFSTAT ←→ ELSESTAT ←←
    create 2 or 3 statements, one for COND, one for IFSTAT and
    optionally one for ELSESTAT.

2. GNU APL lambdas are limited to one APL _expression_ (= one APL statement)
   and the _expression_ must yield a value (and can therefore not be a branch).

3. The normal work-around for this limitation is to use a proper ∇-defined function.

Best Regards,
Jürgen





reply via email to

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