Hi Louis,
B←A
makes B
equivalent to A:
A←{(+⌿⍵)÷≢⍵}
B←A
⎕CR 'A'
λ←λ1 ⍵
λ←(+⌿⍵)÷≢⍵
⎕CR 'B'
λ←λ1 ⍵
λ←(+⌿⍵)÷≢⍵
That is not too useful unless you have different As and want B to
be (conditionally) one of them.
/// Jürgen
On 06/01/2016 03:42 PM, Louis de
Forcrand wrote:
I was just wondering what is supposed to happen if
I do this:
A←{(+⌿⍵)÷≢⍵}
B←A
Is B equivalent to the lambda, or is it a function
that calls A?
Or is this simply supposed to signal an error?
Louis
Hi Xtian,
thanks, fixed in SVN 734.
All lambdas are now "unnamed" and assigning them to a
name, like in
A←{ ... }
does no longer change the name of the lambda (that was
one of the earlier problems)
//// Jürgen
On 05/31/2016 12:04 AM,
Christian Robert wrote:
I was pretty certain this bug
will really be hard to fix.
[xtian@fc-23:/home/xtian] $ apl
______ _ __ __ __ ___
____ __
/ ____// | / // / / / / | /
__ \ / /
/ / __ / |/ // / / / / /| | /
/_/ // /
/ /_/ // /| // /_/ / / ___ | /
____// /___
\____//_/ |_/ \____/ /_/ |_|/_/
/_____/
Welcome to GNU APL version 1.5 /
733
Copyright (C) 2008-2015 Dr. Jürgen
Sauermann
Banner by FIGlet: www.figlet.org
This program comes with ABSOLUTELY NO
WARRANTY;
for details run: apl --gpl.
This program is free software, and you are
welcome to redistribute it
according to the GNU Public License (GPL)
version 3 or later.
)wsid test
WAS CLEAR WS
⎕pw←1000
]boxing 8
a←20?100
b←15?100
cmp_a←{{⍵[⍋⍵]} (∨/[1] ⍺∘.= ⍵) / ⍵}
cmp_b←{{⍵[⍋⍵]} (∨⌿ ⍺∘.= ⍵) / ⍵}
)fns
cmp_a cmp_b
a cmp_a b
┌→──────────┐
│26 50 76 95│
└───────────┘
b cmp_a a
┌→──────────┐
│26 50 76 95│
└───────────┘
⎕nl 3
┌→────┐
↓cmp_a│
│cmp_b│
└─────┘
)save
2016-05-30 17:56:37 (GMT-4) test
)load test
SAVED 2016-05-30 17:56:37 (GMT-4)
)fns
cmp_a cmp_b λ1
⎕cr ¨ ⊂[2] ⎕nl 3
┌→──────────────────────────────────────────────────────────┐
│┌⊖┐ ┌→────────────────────────┐
┌→────────────────────────┐│
│⌽ │ ↓λ←⍺ λ1 ⍵ │ ↓λ←⍺ λ1
⍵ ││
│└─┘ │λ←{⍵[⍋⍵]} (∨⌿ ⍺∘.= ⍵) / ⍵│ │λ←{⍵[⍋⍵]} (∨⌿ ⍺∘.=
⍵) / ⍵││
│ └─────────────────────────┘
└─────────────────────────┘│
└∊──────────────────────────────────────────────────────────┘
⍝ lambda functions lost their names
⍝ cmp_a definition has disapear
⍝ a function name 'λ1' appear
D←{24 ⎕cr ⍵}
)fns
D cmp_a cmp_b λ1
)save
====================================================
SEGMENTATION FAULT
----------------------------------------
-- Stack trace at main.cc:63
----------------------------------------
0x7f3283b029f0
0x4493e7
========================================
====================================================
Goodbye.
[xtian@fc-23:/home/xtian] $
On 2016-05-29 14:15, Juergen Sauermann wrote:
Hi Xtian,
I believe I have corrected the fault. *SVN 732*.
Unfortunately that has required a major rework
(actually a simplification) of the lambda
stuff - I hope everything else still works as
expected.
It is no longer possible to ∇-edit a lambda, but
*⎕CR* still works for displaying
a variable to which a lambda was assigned. The
function name of the lambda
now always begins with *λ* followed by a number:
* FOO←{⍺ + ⍵}**
** ∇FOO[⎕]∇**
**DEFN ERROR+**
** ∇FOO[⎕]∇**
** ^**
** )more**
**function is a lambda
**** ⎕CR 'FOO'**
**λ←⍺ λ1 ⍵**
**λ←⍺ + ⍵ **
*
/// Jürgen
On 05/26/2016 04:38 AM, Christian Robert wrote:
)clear
CLEAR WS
a←20?100
b←15?100
a
77 7 19 54 24 32 84 40 5 95 97 76 82 92 63 26 10
98 21 50
b
38 80 99 90 26 30 74 50 85 81 47 76 93 95 88
a∘.=b
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
cmp←{(∨/[1] ⍺∘.= ⍵) / ⍵}
a cmp b
26 50 76 95
b cmp a
95 76 26 50
)save
NOT SAVED: THIS WS IS CLEAR WS
)wsid test
WAS CLEAR WS
)save
2016-05-25 22:33:41 (GMT-4) test
cmp←{{⍵[⍋⍵]} (∨/[1] ⍺∘.= ⍵) / ⍵}
)save
2016-05-25 22:34:23 (GMT-4) test
a cmp b
====================================================
SEGMENTATION FAULT
----------------------------------------
-- Stack trace at main.cc:63
----------------------------------------
0x7fc41397d9f0
0x4495e7
========================================
====================================================
Goodbye.
[xtian@fc-23:/home/xtian] $ apl
______ _ __ __ __
___ ____ __
/ ____// | / // / / / / |
/ __ \ / /
/ / __ / |/ // / / / / /| |
/ /_/ // /
/ /_/ // /| // /_/ / / ___ | /
____// /___
\____//_/ |_/ \____/ /_/
|_|/_/ /_____/
Welcome to GNU APL version
1.5 / 731
Copyright (C) 2008-2015 Dr.
Jürgen Sauermann
Banner by FIGlet: www.figlet.org
This program comes with ABSOLUTELY
NO WARRANTY;
for details run: apl
--gpl.
This program is free software, and you are
welcome to redistribute it
according to the GNU Public License (GPL)
version 3 or later.
SAVED 2016-05-17 21:09:56 (GMT-4)
)load test
SAVED 2016-05-25 22:34:23 (GMT-4)
a cmp b
26 50 76 95
b cmp a
26 50 76 95
)off
Goodbye.
[xtian@fc-23:/home/xtian] $
|