Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mix (up arrow) in GNU APL?

351 views
Skip to first unread message

Nami Doc

unread,
Oct 21, 2015, 6:24:58 AM10/21/15
to
Hi,

it seems I'm hitting a GNU APL "bug"? (I'm not sure it's a bug, or just that it's not implemented, or that it's not supposed to be implemented).

I've been following tryapl.org's tutorial, and hit the dyadic up arrow, mix:

> ↑ (6 4) 5 0 3

While on the tryapl website, I get the result

> 6 4
> 5 0
> 0 0
> 3 0

With GNU APL, I get this:

> 6 4

So, I'm not sure what to expect. Does GNU APL want this? (if someone was to provide a patch)? Is that outside of its scope?
As a student, I also have access to Dyalog APL (and the experience is amazing, thanks to Dyalog for the quick answer), I'm just wondering if there's a way to run stuff as a "script" like gnu apl's `--noSV -s -f <PATH>`

Thanks!

Rav

unread,
Oct 21, 2015, 8:48:36 AM10/21/15
to
Apparently the TRYAPL website is using an earlier "evolution level" or
"migration level" for what monadic ↑ does. Earlier versions of STSC's
APL+Win defined ↑ as "mix," but later versions defined it as "first"
(and defined monadic ⊃ as mix). The APL+Win system command )EVLEVEL
controls which evolution level the system is running at. Under Dyaloc
APL, ⎕ML controls the same thing but they call it Migration Level. I
don't know if TRYAPL has some mechanism for this, but you can use
monadic ⊃ for mix. (By the way, there are other things that
evolution/migration level controls, such as monadic ∊ and dyadic ⊂).

Rav

unread,
Oct 21, 2015, 8:52:39 AM10/21/15
to
Sorry, I meant under TRYAPL you can use monadic ⊃ for first.

Rav

unread,
Oct 21, 2015, 8:57:47 AM10/21/15
to
Finally (I hope), if you click "About" on the TRYAPL web page, it says
"Migration Level is fixed at 1."

Nami Doc

unread,
Oct 21, 2015, 12:49:45 PM10/21/15
to
Amazing, thanks for your quick answer! I'll go with newer evolution levels then, I don't have anything of the past I need to maintain anyway.

I didn't notice the "evolution level", because I didn't know it was a thing. Is there some kind of "changelog" with the description of the differences?

Thanks again!

Aaron W. Hsu

unread,
Oct 21, 2015, 3:11:41 PM10/21/15
to
On Wed, 2015-10-21 at 09:49 -0700, Nami Doc wrote:

> Amazing, thanks for your quick answer! I'll go with newer evolution
> levels then, I don't have anything of the past I need to maintain
> anyway.
>
> I didn't notice the "evolution level", because I didn't know it was a
> thing. Is there some kind of "changelog" with the description of the
> differences?

I'm not sure I would call different levels of ⎕ML evolutions. If I
understand the story correctly, ⎕ML was introduced as a migration path
to porting APL2 code. If you look at the ⎕ML page on
http://help.dyalog.com you'll find the information you need. I believe a
couple of Dyalog User Meetings ago Morten gave a talk about the status
of ⎕ML and the "new defaults."

At the moment, I believe that ⎕ML is more about picking whatever symbols
and "defaults" you like better for you new code, and picking whatever
level will work for any legacy code you have. One migration level is not
strictly better than any other migration level unless you have other
platforms or code you need to worry about.

Please, someone with more historical experience correct me if I am
mistaken here.

--
Aaron W. Hsu | arc...@sacrideo.us | http://www.sacrideo.us


Nami Doc

unread,
Nov 2, 2015, 3:56:42 PM11/2/15
to
Seems like I've found the same sort of thing, and ML doesn't help here.

Dyalog seems to offer : for short-circuiting, i.e.:

F←{⍵=0:1⋄5}

but it seems this doesn't work in GNU APL. Is this an extension? Is there no kind of "return" like this in GNU APL?

Thanks!

Nami Doc

unread,
Nov 2, 2015, 4:19:53 PM11/2/15
to
Le mercredi 21 octobre 2015 12:24:58 UTC+2, Nami Doc a écrit :
Sorry for the spam, but it seems "⌸" (demonstrated on tryapl.org as well) doesn't work in GNU APL. Maybe these "extensions" are documented in the Dyalog docs, and they're all listed in one page

Thanks again & all of you have a nice day.

lok...@gmail.com

unread,
Nov 2, 2015, 9:53:50 PM11/2/15
to
On Tuesday, 3 November 2015 04:56:42 UTC+8, Nami Doc wrote:

> Dyalog seems to offer : for short-circuiting, i.e.:
>
> F←{⍵=0:1⋄5}
>
> but it seems this doesn't work in GNU APL. Is this an extension? Is there no
> kind of "return" like this in GNU APL?

GNU APL does not allow you to put ◊ in an inline function definition. However, you can use ⊢ and ⊣ to achieve the same effect:

F ← {5+⍵ ⊣ ⎕←'hello'}

This will print "hello" and return 5 + the argument when called.

DanB

unread,
Nov 3, 2015, 3:46:23 AM11/3/15
to
this is not the same thing; Nami`s example refers to an error guard which you cannot use without a diamond. How to you trap errors in GNU APL?

lok...@gmail.com

unread,
Nov 3, 2015, 4:31:56 AM11/3/15
to
On Tuesday, 3 November 2015 16:46:23 UTC+8, DanB wrote:

> this is not the same thing; Nami`s example refers to an error guard which you
> cannot use without a diamond. How to you trap errors in GNU APL?

In GNU APL you have to use ⎕EA:

Assuming that the function "foo" does not exist, so that the call to it
below will result in an error:

f ← {'5' ⎕EA 'foo ',⍕⍵}

Then, if you call f with any argument, you'll get 5 as a result:

f 10
5

Stefano Lanzavecchia

unread,
Nov 3, 2015, 9:46:24 AM11/3/15
to
An error guard is expressed with a double colon in Dyalog APL (i.e. { 0:: expr ⋄ ... }.

A single colon is a simple guard, which can be translated to an "if". The original example {⍵=0:1⋄5} can be read as: if omega is equal to 0 then the result of the function is 1, otherwise it's 5.

That's probably not the most common way to express the snippet in APL (5-4×⍵=0 is probably more idiomatic though it gives a bad name to APL, or 5 1[⎕IO+⍵=0]). Nevertheless at dfns.dyalog.com one can find tons of code where the guard is hard if not impossible to substitute.

ArrayMac

unread,
Nov 3, 2015, 10:44:18 AM11/3/15
to
On Tuesday, 3 November 2015 05:31:56 UTC-4, lok...@gmail.com wrote:
> Then, if you call f with any argument, you'll get 5 as a result:
>
> f 10
> 5

What happens with
f 2 2⍴0

David Lamkins

unread,
Nov 3, 2015, 2:15:27 PM11/3/15
to
A lot of the questions about what GNU APL does or doesn't support are answered by the provided documentation.

As a rule of thumb: GNU APL supports ISO 13751 extended APL and IBM APL2. The GNU APL documentation contains links to reference documents for both.

There's also an info file which includes details about the lower-level extensions implemented only by GNU APL, such as support for scripting and an (experimental) multi-core facility.

As far as I know, the *only* Dyalog extension that has been adopted by GNU APL is its use of {} as a lambda. This is *not* a full-on implementation of D-fns; guards and multiple statements are not supported.

In general, Dyalog APL code will not port directly to GNU APL.

Nami Doc

unread,
Nov 3, 2015, 3:11:21 PM11/3/15
to
Hi,

last time, while browsing the documentation, I tried googling for ISO 13751, but it seemed to cost quite a few bucks. That's not an investment I'm making.

That's also why I asked for a list of Dyalog extensions (I'm not using dyalog because I want to run the files as a script, and GNU APL is great in that regards; with -S + )OFF at the end of the script), but I'm not sure there's such one.

Anyway, I understand GNU APL doesn't implement guard (it seems other forms will have to evaluate both forms, as in `1 2[1]`, so not applicable to recursive functions, say.

Aaron W. Hsu

unread,
Nov 3, 2015, 6:02:58 PM11/3/15
to
On Tue, 2015-11-03 at 12:11 -0800, Nami Doc wrote:
> That's also why I asked for a list of Dyalog extensions (I'm not using
> dyalog because I want to run the files as a script, and GNU APL is
> great in that regards; with -S + )OFF at the end of the script), but
> I'm not sure there's such one.

I'd be interested to know what's inadequate about Dyalog's scripting
facilities? I'm sure the Dyalog people would be interested in knowing
this to. There is ⎕LX obviously, but there is also dyapp files and SALT
scripts and some scripting options on the command line.

Nami Doc

unread,
Nov 4, 2015, 4:10:14 AM11/4/15
to
Well, at least from browsing the documentation I haven't been able to find how to run a .apl (or .dyalog, for that matters) file as a one-time script, with no workspace involved.

In GNU APL, I just run `apl --noSV -s -f` (to not run a server, silence the banner, and set a file as input), my files also ends with `)OFF`, so it's really a one-time script. I havn't found in Dyalog's docs how to do that. From what I'm reading on SALT, it doesn't seem to do that. I'd be very interested if you had something I can read (that does dyalog scripting).

Thanks!

Stefano Lanzavecchia

unread,
Nov 4, 2015, 9:25:59 AM11/4/15
to
You can easily try it: http://tryapl.org/?a=f%u2190%7B%u2375%3D0%3A1%u22C45%7D%20%u22C4%20f%202%202%u23740&run

But obviously it's a LENGTH ERROR since a guard must evaluate to a boolean singleton.

ArrayMac

unread,
Nov 4, 2015, 11:08:49 AM11/4/15
to
On Wednesday, 4 November 2015 10:25:59 UTC-4, Stefano Lanzavecchia wrote:

> You can easily try it: http://tryapl.org/?a=f%u2190%7B%u2375%3D0%3A1%u22C45%7D%20%u22C4%20f%202%202%u23740&run
>
> But obviously it's a LENGTH ERROR since a guard must evaluate to a boolean singleton.

Should have quoted more:
> f ← {'5' ⎕EA 'foo ',⍕⍵}
>
> Then, if you call f with any argument, you'll get 5 as a result:

(a time one misses J's rank....)


Aaron W. Hsu

unread,
Nov 4, 2015, 3:49:02 PM11/4/15
to
On Wed, 2015-11-04 at 08:08 -0800, ArrayMac wrote:
> (a time one misses J's rank....)

I love that Dyalog has finally put Rank into the language. I use it all
the time.

Aaron W. Hsu

unread,
Nov 4, 2015, 4:00:18 PM11/4/15
to

On Wed, 2015-11-04 at 01:10 -0800, Nami Doc wrote:
> Le mercredi 4 novembre 2015 00:02:58 UTC+1, Aaron W. Hsu a écrit :
> > On Tue, 2015-11-03 at 12:11 -0800, Nami Doc wrote:
> > > That's also why I asked for a list of Dyalog extensions (I'm not using
> > > dyalog because I want to run the files as a script, and GNU APL is
> > > great in that regards; with -S + )OFF at the end of the script), but
> > > I'm not sure there's such one.
> >
> > I'd be interested to know what's inadequate about Dyalog's scripting
> > facilities? I'm sure the Dyalog people would be interested in knowing
> > this to. There is ⎕LX obviously, but there is also dyapp files and SALT
> > scripts and some scripting options on the command line.
>
> Well, at least from browsing the documentation I haven't been able to
> find how to run a .apl (or .dyalog, for that matters) file as a
> one-time script, with no workspace involved.
>
> In GNU APL, I just run `apl --noSV -s -f` (to not run a server, silence
> the banner, and set a file as input), my files also ends with `)OFF`,
> so it's really a one-time script. I havn't found in Dyalog's docs how
> to do that. From what I'm reading on SALT, it doesn't seem to do that.
> I'd be very interested if you had something I can read (that does
> dyalog scripting).

There is a similar combination of options that you can run on mapl to
get the same results as you describe above, but I am not sure many
people use it. The dyapp functionality is a part of SALT and can be
found on page 8 of the SALT Reference Guide. It's more flexible than
what you're describing, but it also would be able to do what you're
talking about without any workspaces. However, you'd want to use ⎕OFF
instead of )off inside of your "entry/main" function instead of )off.
Otherwise I think you'll find things mostly the same in terms of
functionality.

The scripting function like above is available *somewhere* in the
documentation, but I don't know where. I've used it once or twice before
a long time ago.

lok...@gmail.com

unread,
Nov 5, 2015, 3:32:25 AM11/5/15
to
On Thursday, 5 November 2015 04:49:02 UTC+8, Aaron W. Hsu wrote:
> On Wed, 2015-11-04 at 08:08 -0800, ArrayMac wrote:
> > (a time one misses J's rank....)
>
> I love that Dyalog has finally put Rank into the language. I use it all
> the time.

What does rank do?

DanB

unread,
Nov 5, 2015, 6:03:21 AM11/5/15
to
It splits the arguments on the last number of axes specified then applies the function, then reassembles the results. For ex ⌹ is restricted to matrices (rank 2 arrays) so giving it a 3D array fails in most APLs:
⍴⌹ 3 4 4⍴÷⍳99
RANK ERROR

you can change that by specifying ⌹ to work on matrices only:
⍴(⌹⍤2) 3 4 4⍴÷⍳99
3 4 4

Jane Sullivan

unread,
Nov 5, 2015, 8:20:44 AM11/5/15
to
On 04/11/2015 21:00, Aaron W. Hsu wrote:
> The scripting function like above is available*somewhere* in the
> documentation, but I don't know where. I've used it once or twice before
> a long time ago.

My numbers.dyapp file contains these two lines

Load Numbers\Setup
Run Setup.Start

Obviously my apl SALT configuration is set up so the Load statement
finds the Setup.dyalog file in the Numbers subdirectory of one of the
directories.

I have a shortcut for this on the desktop, the "target" of which is

"C:\Program Files (x86)\Dyalog\Dyalog APL 14.1 Unicode\dyalog.exe"
log_file="..\..\Dyalog APL Unicode Files\Numbers.dlf" dyapp=Numbers.dyapp

and "Start in" is set appropriately.

This all works wonderfully well. My reasons for doing things this way
have to do with Numbers being the client part of a client-server
relationship, and there being several windows open when the program is
running. As you are aware, you cannot save a workspace when there are
windows open or programs running, but you can save amendments to SALT
files under these conditions. So doing things this way makes perfect sense.



Best wishes
--
Jane

ArrayMac

unread,
Nov 5, 2015, 9:38:13 AM11/5/15
to
On Wednesday, 4 November 2015 16:49:02 UTC-4, Aaron W. Hsu wrote:
> On Wed, 2015-11-04 at 08:08 -0800, ArrayMac wrote:
> > (a time one misses J's rank....)
>
> I love that Dyalog has finally put Rank into the language. I use it all
> the time.

Yes, a 14.0 enhancement, using ⍤ (memories of I.P. Sharp... I wonder where on the keyboard they put it.) . One of the many good consequences of Dyalog's hiring of Hui. Also good: the under-the-radar addition of f\ inv to provide a shorter version of 2 f /

lok...@gmail.com

unread,
Nov 6, 2015, 12:39:29 AM11/6/15
to
This works in GNU APL as well, although due to some issues with the parser you
have to put parentheses around the right-hand argument. I don't know if that's a
bug or not. I know that the ISO spec is poorly written on the topic of ⍤.

This works:

⍴(⌹⍤2) (3 4 4⍴÷⍳99 )
3 4 4

You can even skip the first set of parentheses:

⍴⌹⍤2 (3 4 4⍴÷⍳99 )
3 4 4

Nami Doc

unread,
Nov 7, 2015, 4:30:28 AM11/7/15
to
From what I can see in http://docs.dyalog.com/14.1/Dyalog%20APL%20for%20UNIX%20User%20Guide.pdf, I still need a workspace. A bare code file won't cut it. I'm not sure there any more options than those presented in the document?

Aaron W. Hsu

unread,
Nov 7, 2015, 3:19:24 PM11/7/15
to
On Sat, 2015-11-07 at 01:30 -0800, Nami Doc wrote:
> From what I can see in http://docs.dyalog.com/14.1/Dyalog%20APL%20for%
> 20UNIX%20User%20Guide.pdf, I still need a workspace. A bare code file
> won't cut it. I'm not sure there any more options than those presented
> in the document?

You need to read the SALT Reference Guide. I don't know where it is
online, but it's included in the help/ directory of your Dyalog
installation. Ah, here's the online URL:

http://docs.dyalog.com/14.1/Dyalog%20APL%20SALT%20Reference%20Guide.pdf

DanB

unread,
Nov 11, 2015, 7:20:03 AM11/11/15
to
On Saturday, November 7, 2015 at 4:30:28 AM UTC-5, Nami Doc wrote:
> From what I can see in http://docs.dyalog.com/14.1/Dyalog%20APL%20for%20UNIX%20User%20Guide.pdf, I still need a workspace. A bare code file won't cut it. I'm not sure there any more options than those presented in the document?

I am not sure of what you mean by "I still need a workspace". When APL runs it uses some memory like any other program you may run. You can take a snapshot of that memory (programs and variables) anytime and store it on file. But you don't HAVE to, you can simply exit when you're finished. In Dyalog you can initialize this memory with a simple text file which can be read thru standard input or read via another program, e.g. SALT's Boot program.

ArrayMac

unread,
Nov 11, 2015, 10:15:20 AM11/11/15
to
On Wednesday, 11 November 2015 08:20:03 UTC-4, DanB wrote:
>
> I am not sure of what you mean by "I still need a workspace".

How about: how do I )load a script into a bare session? Is it only possible with a SALT utility?

Aaron W. Hsu

unread,
Nov 12, 2015, 3:12:01 AM11/12/15
to
On Wed, 2015-11-11 at 07:15 -0800, ArrayMac wrote:
> how do I )load a script into a bare session? Is it only possible with
> a SALT utility?

See the SALT documentation, the ]load user utility, and the :Namespace
script.

ArrayMac

unread,
Nov 12, 2015, 9:53:26 AM11/12/15
to
On Thursday, 12 November 2015 04:12:01 UTC-4, Aaron W. Hsu wrote:
> On Wed, 2015-11-11 at 07:15 -0800, ArrayMac wrote:
> > how do I )load a script into a bare session? Is it only possible with
> > a SALT utility?
>
> See the SALT documentation, the ]load user utility, and the :Namespace
> script.


+1 on the answer to question 0. How about question 1?

Aaron W. Hsu

unread,
Nov 12, 2015, 6:19:54 PM11/12/15
to
Assuming you're talking about a :Namespace Script, have you seen ⎕FIX?

ArrayMac

unread,
Nov 13, 2015, 9:47:56 AM11/13/15
to
On Thursday, 12 November 2015 19:19:54 UTC-4, Aaron W. Hsu wrote:
> Assuming you're talking about a :Namespace Script, have you seen ⎕FIX?

Is that a post v.12 addition(, given I can only see ⎕FX)?

question 1. by the way, was 'is it only possible with a SALT utility?' I can understand you may have designated it 0.a.

Aaron W. Hsu

unread,
Nov 13, 2015, 7:18:37 PM11/13/15
to
I do not know when it was added. If you look at the standard Dyalog
documentation for 14.1, you'll see information about :Namespace Scripts
and the like, which is everything that you need to load namespaces from
files, particularly []FIX.

I am also quite sure that there is some method of suppressing the
standard environment in Dyalog, and that will let you `cat` whatever
data you want directly into the session, which in practice I imagine
will work a lot like the SALT system.

However, the SALT system was designed specifically to aid in providing a
plain text interface for APL programming. Is there a reason you wouldn't
want to use it?

ArrayMac

unread,
Nov 14, 2015, 11:02:55 AM11/14/15
to
On Friday, 13 November 2015 20:18:37 UTC-4, Aaron W. Hsu wrote:

> However, the SALT system was designed specifically to aid in providing a
> plain text interface for APL programming. Is there a reason you wouldn't
> want to use it?

Other than the fact I have had tools matching the functionality of SALT since the 80s, and that I prefer not to learn the quirks of a new wheel when the old one works fine with only a little rework, no.

(I wonder if you mean ⎕FX when you say ⎕FIX...)

Aaron W. Hsu

unread,
Nov 14, 2015, 3:06:37 PM11/14/15
to
No, I mean ⎕FIX. ⎕FX is for functions/operators. ⎕FIX is for scripted
objects, basically either namespaces or classes. Here's a quote from the
documentation [1]:

> ⎕FIX fixes a Class from the script specified by Y.
>
> Y must be a vector of character vectors or character scalars that
> contains a well-formed Class script. If so, the shy result R is a
> reference to the new Class fixed by ⎕FIX.
>
> The Class specified by Y may be named or unnamed.

If you want to roll your own (as it seems you already have), that's a
perfectly valid reason to not use SALT. SALT makes code sharing easier;
if you don't care about that, then there isn't a compelling reason to
use it if the stuff you have works fine for you.

I'm still sort of confused though, as to why multiple people have found
it so difficult to find this information in the documentation. Maybe
I've become too accustomed to the documentation? Since I like to see the
documentation improve, it would be helpful to know what prevented people
in this thread from finding information on Namespace scripts, SALT,
dyapp files, and the ⎕FIX function. I used help.dyalog.com for the most
part. It's an important part of functionality that many people would
want, especially coming from other languages where editing text files is
the norm.

[1] http://help.dyalog.com/14.1/Content/Language/System%
20Functions/fix.htm

J. Clarke

unread,
Nov 14, 2015, 7:37:30 PM11/14/15
to
In article <12889545-7dd3-4bd3...@googlegroups.com>,
arra...@rogers.com says...
> (I wonder if you mean ?FX when you say ?FIX...)

Aaron, are those tools that you developed or are they commercially
available? Is there more information available anywhere?

Aaron W. Hsu

unread,
Nov 15, 2015, 1:32:12 AM11/15/15
to
On Sat, 2015-11-14 at 19:39 -0500, J. Clarke wrote:
> Aaron, are those tools that you developed or are they commercially
> available? Is there more information available anywhere?

I'm not sure if you are referring to ArrayMac's home-rolled stuff or
SALT. If you are talking about SALT, that's a system distributed by
Dyalog that has been available there for a while now.

Jane Sullivan

unread,
Nov 15, 2015, 5:45:53 AM11/15/15
to
On 14/11/2015 20:06, Aaron W. Hsu wrote:
> I'm still sort of confused though, as to why multiple people have found
> it so difficult to find this information in the documentation. Maybe
> I've become too accustomed to the documentation? Since I like to see the
> documentation improve, it would be helpful to know what prevented people
> in this thread from finding information on Namespace scripts, SALT,
> dyapp files, and the ⎕FIX function. I used help.dyalog.com for the most
> part. It's an important part of functionality that many people would
> want, especially coming from other languages where editing text files is
> the norm.

Maybe it's part of the macho programmer attitude: "I'm a programmer; I'm
an expert; I don't need to read the documentation."

This attitude doesn't work.

Best wishes
--
Jane

J. Clarke

unread,
Nov 15, 2015, 7:18:12 AM11/15/15
to
In article <1447569131.3...@mantis.site>, arc...@sacrideo.us
says...
>
> On Sat, 2015-11-14 at 19:39 -0500, J. Clarke wrote:
> > Aaron, are those tools that you developed or are they commercially
> > available? Is there more information available anywhere?
>
> I'm not sure if you are referring to ArrayMac's home-rolled stuff or
> SALT. If you are talking about SALT, that's a system distributed by
> Dyalog that has been available there for a while now.

No, I was referring to ArrayMac's stuff--I think I got my attributions
confused. Dyalog would mean persuading the Powers That Be to change the
whole company over from APL2000 and that's not gonna happen.


ArrayMac

unread,
Nov 15, 2015, 10:59:25 AM11/15/15
to
On Saturday, 14 November 2015 16:06:37 UTC-4, Aaron W. Hsu wrote:

> No, I mean ⎕FIX.

Oh, a v14.0 enhancement. I wondered if the mention I gave of working with v12.0 was lost in the ether.

I suppose I'll see this when I read the future-to-me docs.

Aaron W. Hsu

unread,
Nov 16, 2015, 1:04:12 AM11/16/15
to
Someone who has more history with Dyalog should know, but I think this
was a feature since at least 13.2.

ArrayMac

unread,
Nov 16, 2015, 11:13:38 AM11/16/15
to
On Monday, 16 November 2015 02:04:12 UTC-4, Aaron W. Hsu wrote:

> Someone who has more history with Dyalog should know, but I think this
> was a feature since at least 13.2.

That begs a question: Does (⎕FIX⍨¯1) exist?

ArrayMac

unread,
Nov 16, 2015, 11:25:08 AM11/16/15
to
On Sunday, 15 November 2015 06:45:53 UTC-4, Jane Sullivan wrote:
> Maybe it's part of the macho programmer attitude: "I'm a programmer; I'm
> an expert; I don't need to read the documentation."
>
> This attitude doesn't work.

+1 on the not working part. I do read the documentation, enough to still miss the times Christopher Lee maintained the APL+ docs. The attitude I find troublesome is 'we know how it works. Why should we tell you?'

Jane Sullivan

unread,
Nov 16, 2015, 4:51:01 PM11/16/15
to
Unfortunately it does not. You get a DOMAIN ERROR.

Best wishes
--
Jane

Stefano Lanzavecchia

unread,
Nov 17, 2015, 9:22:43 AM11/17/15
to
⎕FIX⍨¯1
is, by definition:
¯1 ⎕FIX ¯1

I'll venture a guess: maybe you meant: ⎕FIX⍣¯1?
If that's the case, the inverse of ⎕FIX is ⎕SRC. http://help.dyalog.com/14.1/Content/Language/System%20Functions/src.htm


--
Stefano

DanB

unread,
Nov 17, 2015, 9:49:10 AM11/17/15
to
> Aaron W. Hsu | arcfide@... | http://www.sacrideo.us

SALT has been with Dyalog since V11, UCMDs since 12.1.
The benefit of using SALT is that it is simple (Simple APL Library Toolkit) and it works with Unicode. I too had tools from the 80s but they could not cope with the modern world so I switched to SALT.

DanB

unread,
Nov 17, 2015, 9:49:46 AM11/17/15
to
yes, it's called ⎕SRC

ArrayMac

unread,
Nov 18, 2015, 11:15:29 AM11/18/15
to
On Tuesday, 17 November 2015 10:22:43 UTC-4, Stefano Lanzavecchia wrote:

> I'll venture a guess: maybe you meant: ⎕FIX⍣¯1?

Yes, thnk you! Sorry about the typo.

I thought it was something like []VR, and I do recall []SRC being mentioned in the same breath.

ArrayMac

unread,
Nov 18, 2015, 1:14:07 PM11/18/15
to
On Tuesday, 17 November 2015 10:49:10 UTC-4, DanB wrote:

> SALT has been with Dyalog since V11, UCMDs since 12.1.
> The benefit of using SALT is that it is simple (Simple APL Library Toolkit) and it works with Unicode. I too had tools from the 80s but they could not cope with the modern world so I switched to SALT.

I did not have the luxury of my tools going obsolete. Also, I'm sure there are more details to 'works with Unicode' and I would like to hear them. Like Y2K, my experience moving to Unicode was anticlimactic.

One thing I _did_ discover: scripted objects are a subset of Namespaces, where the script comes before the object, therefore []src merely uses the string created with []fix or )ed. I can only guess that arriving at a suitable way to code variable assignments made the developers balk at being able to []src all possible namespaces, thus the NONCE ERROR's I've seen.

This does suggest building 'qSRC' as an extension of []src.

Aaron W. Hsu

unread,
Nov 18, 2015, 4:17:13 PM11/18/15
to

On Wed, 2015-11-18 at 10:14 -0800, ArrayMac wrote:
> One thing I _did_ discover: scripted objects are a subset of
> Namespaces, where the script comes before the object, therefore []src
> merely uses the string created with []fix or )ed. I can only guess that
> arriving at a suitable way to code variable assignments made the
> developers balk at being able to []src all possible namespaces, thus
> the NONCE ERROR's I've seen.

I'm not sure what you mean here? I don't usually use ⎕SRC to do this
sort of thing. I think I get why you're using it, but for me, when I
want to serialize a Namespace to a textual representation I use the SALT
Save function or the ]save UCMD for this. You can do this conversion for
any normal APL object that I'm aware of, including variables, namespace,
classes, and functions/operators. I believe for SALT'ing variables by
themselves there is an XML representation and a "APL Expression"
version. If you SALT a Namespace with variables in it, you'll see the
expression format embedded into the Namespace script that is created.

ArrayMac

unread,
Nov 19, 2015, 10:54:14 AM11/19/15
to
On Wednesday, 18 November 2015 17:17:13 UTC-4, Aaron W. Hsu wrote:

> I'm not sure what you mean here? I don't usually use ⎕SRC to do this
> sort of thing. I think I get why you're using it, but for me, when I
> want to serialize a Namespace to a textual representation I use the SALT
> Save function or the ]save UCMD for this.

This illustrates the difference in our perspectives. I've been developing software since long before Dyalog, much less SALT came on the scene. Rather than wait for platforms to possibly catch up, I needed to get something done.

This SALT Save process you mention, I expect, on viewing the source, to see something I could put together in a handful, or smaller, of lines:

('Namespace',⍕ns) (ns.quotename ¨ns.⎕nl 2 3) ':EndNamespace'

> You can do this conversion for
> any normal APL object that I'm aware of, including variables, namespace,
> classes, and functions/operators. I believe for SALT'ing variables by
> themselves there is an XML representation and a "APL Expression"
> version. If you SALT a Namespace with variables in it, you'll see the
> expression format embedded into the Namespace script that is created.

I have to take an iTunes attitude towards this: I don't want all the baggage of SALT for a single piece of functionality.

David Lamkins

unread,
Nov 24, 2015, 12:35:05 PM11/24/15
to
On Tuesday, November 3, 2015 at 12:11:21 PM UTC-8, Nami Doc wrote:
> Le mardi 3 novembre 2015 20:15:27 UTC+1, David Lamkins a écrit :
> > A lot of the questions about what GNU APL does or doesn't support are answered by the provided documentation.
> >
> > As a rule of thumb: GNU APL supports ISO 13751 extended APL and IBM APL2. The GNU APL documentation contains links to reference documents for both.
> >
> > There's also an info file which includes details about the lower-level extensions implemented only by GNU APL, such as support for scripting and an (experimental) multi-core facility.
> >
> > As far as I know, the *only* Dyalog extension that has been adopted by GNU APL is its use of {} as a lambda. This is *not* a full-on implementation of D-fns; guards and multiple statements are not supported.
> >
> > In general, Dyalog APL code will not port directly to GNU APL.
>
> Hi,
>
> last time, while browsing the documentation, I tried googling for ISO 13751, but it seemed to cost quite a few bucks. That's not an investment I'm making.


Fortunately, you need not do so.

From the README-7-more-info file in the GNU APL distribution:

"The ISO standard implemented by GNU APL can be found here:

www.math.uwaterloo.ca/~ljdickey/apl-rep/docs/is13751.pdf

Note that this file is, despite of its .pdf extension, a gzip compressed
PDF file. You have to fetch it, rename it, and then gunzip it:

wget www.math.uwaterloo.ca/~ljdickey/apl-rep/docs/is13751.pdf
mv is13751.pdf is13751.pdf.gz
gunzip is13751.pdf.gz
"


>
> That's also why I asked for a list of Dyalog extensions (I'm not using dyalog because I want to run the files as a script, and GNU APL is great in that regards; with -S + )OFF at the end of the script), but I'm not sure there's such one.
>
> Anyway, I understand GNU APL doesn't implement guard (it seems other forms will have to evaluate both forms, as in `1 2[1]`, so not applicable to recursive functions, say.

0 new messages