Re: libapl stdout

2023-01-14 Thread Elias Mårtenson
Those variables are C++ variables, so the names are probably mangled. You can try to change the GNU APL code to declare them as extern "C". Den sön 15 jan. 2023 07:19 skrev: > Hi > > I'm still trying to resolve the failure of fpc using libapl to get it's > stdout > > trying to get libapl stdout

Re: Reassignment of a nested array element

2023-03-07 Thread Elias Mårtenson
I think this is because monadic ⊃ is first in Dyalog, as opposed to disclose in GNU, APL2 (and, incidentally, KAP 😀). Use monadic ↑ instead to get the effect you want. Den ons 8 mars 2023 00:34Dr. Jürgen Sauermann skrev: > Hi Hans-Peter, > > I believe that GNU APL, Dyalog, and IBM APL2 only now

Re: A curious bug...

2023-05-30 Thread Elias Mårtenson
I don't have an answer. I'm going to have to have a look. Hopefully I'll have some time tomorrow. Den tis 30 maj 2023 20:49Emmanuel Charpentier skrev: > Le mardi 30 mai 2023 à 12:26 +0200, Dr. Jürgen Sauermann a écrit : > > Hi Emmanuel, > > I cant quite explain this fully, but if I copy-and-past

Re: Niladic functions vs niladic lambdas

2023-06-08 Thread Elias Mårtenson
You note an inconsistency, but the problem isn't worth the lambda syntax but rather with assignment. In the lambda syntax of Dyalog, the left arrow are used both to assign functions as well as values, which makes the evaluation rules complicated. I came across the same problem when I implemented i

Re: [EXTERNAL]Building GNU APL with clang

2023-10-03 Thread Elias Mårtenson
I'm pretty sure tge use of auto_ptr can be changed to unique_ptr here. I think I used auto_ptr because I wanted it to work on versions of C++ which didn't support unique_ptr. Den tis 3 okt. 2023 20:17Dr. Jürgen Sauermann skrev: > Hi, > > thank you all for discussing this. > > To address at least

Re: Getting started with APL

2023-12-19 Thread Elias Mårtenson
You can use it, and even use the free version of Dyalog to try things out. Most skills are transferable between all the different array language implementations. Most of which are free and open source by the way. You can also check out aplwiki: https://aplwiki.com/ There's a lot of useful informa

Re: [Bug-apl] [patch] float scanning broken for certain numeric locales & suggestions

2014-01-27 Thread Elias Mårtenson
On 27 January 2014 04:34, Robin Haberkorn wrote: > * You should not commit generated files (autotools) into the SVN > repository. Everyone who has to regenerate the autotools files for > one reason or another is left with dozens of locally changed files > and will face merge conflic

Re: [Bug-apl] [patch] float scanning broken for certain numeric locales & suggestions

2014-01-27 Thread Elias Mårtenson
oided by "make distclean" before "svn > up". > > /// Jürgen > > > > On 01/27/2014 10:18 AM, Elias Mårtenson wrote: > >* You should not commit generated files (autotools) into the SVN > >> repository. Everyone who has to regenerate the a

[Bug-apl] Transpose crashes when faced with empty array

2014-01-27 Thread Elias Mårtenson
Very easy to reproduce this one: ⍉⍬ This gives the following error: == Assertion failed: !shape.is_empty() in Function: ArrayIteratorBase in file: ArrayIterator.cc:31 Call stack:

[Bug-apl] Build failure on OSX

2014-01-28 Thread Elias Mårtenson
In the function Tokenizer::scan_real(), there is a call to exp10(). This function is unique to glibc and does not exist on OSX (and likely not on FreeBSD either, although I haven't checked). Changing the call to exp10(x) to pow(10, x) makes it work. Regards, Elias

[Bug-apl] 8⎕CR on empty string array prints strange result

2014-01-28 Thread Elias Mårtenson
If I create an empty character array by selecting ⍬ from an array that contains a string and a number, the result becomes what seems to be an empty array with non-zero shape. The issue can best be explain by the following interaction. Note the strange output from 8⎕CR: a←('foo' 9)[⍬]

[Bug-apl] Cleanup when SIGINT or SIGHUP is encountered

2014-01-29 Thread Elias Mårtenson
Currently, the cleanup() function is never called when the process is killed. This causes the Emacs plugin to leave the socket file in /tmp. It would also prevent the terminal colour settings from being restored. Attached is a patch that fixes this for these signals. My only concern is with the n

Re: [Bug-apl] 8⎕CR on empty string array prints strange result

2014-01-30 Thread Elias Mårtenson
simple vector. > > Also see http://www.sudleyplace.com/APL/Prototype%20Functions.pdf > > On 1/29/14, Elias Mårtenson wrote: > > If I create an empty character array by selecting ⍬ from an array that > > contains a string and a number, the result becomes what seems to be an > &g

[Bug-apl] Strange behaviour of ,/

2014-01-31 Thread Elias Mårtenson
As far as I understand, OP/ is supposed to splice OP in between every element in the array and return the result. Based on this, I would expect that ,/1 2 3 4 and 1,2,3,4 to be equivalent. However, they are not, as can be seen in the below paste: *8⎕CR ,/1 2 3 4* ┌─┐ │┌→──┐│ ││1

Re: [Bug-apl] Strange behaviour of ,/

2014-01-31 Thread Elias Mårtenson
Wow. I need to read (and understand) the spec, clearly. Thanks for explaining this to me. Regards, Elias On 1 February 2014 03:52, Kacper Gutowski wrote: > On 2014-02-01 01:37:23, Elias Mårtenson wrote: > > As far as I understand, OP/ is supposed to splice OP in between every > el

[Bug-apl] Potential performance optimisation tested

2014-02-02 Thread Elias Mårtenson
I made a test implementation of a performance optimisation for GNU APL. The short story is that it seems to work for limited tests, but there may be issues with my approach and I don't want to spend any more time on it unless Jürgen agrees it's a good idea. After all, I may have completely misunder

Re: [Bug-apl] Strange behaviour of ,/

2014-02-03 Thread Elias Mårtenson
*↑,/1 2 3* 1 2 3 What's going on here? Regards, Elias On 3 February 2014 18:07, Jay Foad wrote: > On 31 January 2014 17:37, Elias Mårtenson wrote: > > 8⎕CR ,/1 2 3 4 > > ┌─┐ > > │┌→──┐│ > > ││1 2 3 4││ > > │└───┘│ > >

Re: [Bug-apl] Can anything be done about the mailer's choice of encoding?

2014-02-04 Thread Elias Mårtenson
He seems to be using the email digests. It's possible that the digest feature doesn't take encoding into account. That wouldn't surprise me given how old and unmaintained the listserv software is. Regards, Elias On 5 February 2014 15:28, Jay Foad wrote: > The emails I get are full of beautiful

[Bug-apl] No errro message when defining functions using

2014-02-07 Thread Elias Mårtenson
When I try to define a function that takes no arguments, but does include an axis argument, the normal function editor complains: *∇foo[x]* bad editor command '∇foo[x]' : problem 'Bad function header at Nabla.cc:495' DEFN ERROR ∇foo[x] ^ However, if I try to define the sa

[Bug-apl] Importing large arrays into GNU APL runtime

2014-02-11 Thread Elias Mårtenson
I wanted to use GNU APL to work with a fairly large dataset. The data is statistical output from a benchmark and it's 951192 rows and 10 columns. 8 of the columns are text (around 10 or so characters each) and the remaining two are numeric. The data is in a single text file. I have had no end of t

[Bug-apl] Implementing realtime variable viewer support

2014-02-11 Thread Elias Mårtenson
I was watching this video where they take advantage of the )ED command in Dyalog which supports realtime updated views of a variable: http://youtu.be/a9xAKttWgP4?t=5m2s At 5:02 into the above video, the presenter types )ED variablename which opens a window that with the content of a variable. This

[Bug-apl] External tools acting on interpreter commands (nabla and )ED)

2014-02-12 Thread Elias Mårtenson
Right now, the Emacs mode preprocesses all input being typed by the user, and if he types ∇ followed by a symbol name, the external function editor is opened and the command is never actually sent to the interpreter. This works fairly well, but there are some annoyances: - Emacs doesn't know if

Re: [Bug-apl] External tools acting on interpreter commands (nabla and )ED)

2014-02-12 Thread Elias Mårtenson
My Emacs mode already uses the external function editor. You access it using C-c C-f. What I did was also to detect when ∇ is typed, and intercept that command to also open up the function editor that way. Thus, right now, there are two ways to open the function editor in Emacs. The reason I did t

[Bug-apl] Dyadic / (replicate) does not work with ¨ (each)

2014-02-12 Thread Elias Mårtenson
The following gives a syntax error: *((1 1) (1 0))/¨'ab' 'cd'* SYNTAX ERROR (1 1) (1 0)/¨'ab' 'cd' ^ ^ But, assuming the following function: ∇Z←X sel Y Z←X/Y ∇ This works: *((1 1) (1 0))sel¨'ab' 'cd'* ab c Regards, Elias

Re: [Bug-apl] No errro message when defining functions using

2014-02-13 Thread Elias Mårtenson
be that you had foo defined earlier? > > The syntax error is then due to a niladic function called with an axis > (which is no a valid pattern in APL). > > The return value of 1 is the index of the line that has caused the error > (foo[x]). > > /// Jürgen > > > >

Re: [Bug-apl] Overbar not allowed in Gnu APL variable names but is in ISO/IEC 13751:2000(E)

2014-02-14 Thread Elias Mårtenson
Thanks for this. I have also updated the Emacs mode to acknowledge the overbar when parsing symbols. On 14 February 2014 23:41, Juergen Sauermann wrote: > Hi Fred, > > I have added overbar to the characters allowed in variable names. see SVN > 121. > > I haven't seen ¯ in variable names either,

Re: [Bug-apl] Potential performance optimisation tested

2014-02-15 Thread Elias Mårtenson
> Elias, >> >> This approach to optimizating Gnu APL sounds very reasonable to >> me. I >> hope it succeeds. May Conway's "Game of Life" go faster. :-) >> >> Fred >> >> On Sun, 2014-02-02 at 21:19 +0800, Elias Mårtenson wrote: >

Re: [Bug-apl] Implementing realtime variable viewer support

2014-02-15 Thread Elias Mårtenson
monitor(const Symbol & symbol, Symbol_Event sev) > { >// ... > } > > Symbol * monitored = ... > > monitored->set_monitor_callback(my_monitor); // start monitoring > monitored->set_monitor_callback(0);// stop monitoring > > See SVN 124. > &

Re: [Bug-apl] Implementing realtime variable viewer support

2014-02-16 Thread Elias Mårtenson
. Can this instance ever be changed? I.e. can I use &symbol as a key into a std::map that tracks all active listeners? Regards, Elias On 15 February 2014 19:55, Elias Mårtenson wrote: > Awesome. I'll add support for this tonight or tomorrow. > > Regards, > Elias > >

[Bug-apl] Unterminated strings does not result in error

2014-02-17 Thread Elias Mårtenson
If I type the following: *'foo* It is parsed as: *'foo'* Instead of giving an error. Is this expected behaviour? To me, it would make much more sense if this was flagged as a syntax error. Regards, Elias

[Bug-apl] Calling Value::print() with different ⎕PW

2014-02-17 Thread Elias Mårtenson
In my native code, I would like to be able to get a printable representation of a Value_P as if ⎕PW was set to some very large value (effectively unlimited). What is the most efficient way to do this? I was trying to call assign on the return value from Workspace::get_v_Quad_PW(), but I got a DOM

Re: [Bug-apl] Calling Value::print() with different ⎕PW

2014-02-18 Thread Elias Mårtenson
dify these data structures, then > it becomes impossible for me to > maintain the interpreter. > > /// Jürgen > > > > > On 02/18/2014 04:58 AM, Elias Mårtenson wrote: > > In my native code, I would like to be able to get a printable > representation of a Value_P

[Bug-apl] Emacs mode updates

2014-02-18 Thread Elias Mårtenson
So, I've been working on the Emacs mode some more in order to be ready for the 1.3 release of GNU APL, and I have no completed the following new features (on top of what is in the master branch right now). The development version is in the branch called "native" of you want to check it out: https:

[Bug-apl] Lambda functions are not loaded from a workspace

2014-02-18 Thread Elias Mårtenson
When loading a workspace that was previously saved using the )SAVE command, any functions defined using name←{...} are not loaded. The functions are there, as they can be seen in the XML file, but they are ignored when loading. Regards, Elias

[Bug-apl] How to get SEV_ERASED event?

2014-02-19 Thread Elias Mårtenson
I have a hard time testing the Emacs mode's treatment of SEV_ERASE, as I can't seem to get such event. Nothing I tried (including calling )ERASE on it) causes this to happen. When is this event sent? Regards, Elias

Re: [Bug-apl] How to get SEV_ERASED event?

2014-02-19 Thread Elias Mårtenson
Thank you. Now it all works correctly, and the window is closed automatically when the symbol is erased. Regards, Elias On 19 February 2014 21:09, Juergen Sauermann wrote: > Hi, > > A←1 2 3 > ⎕EX 'A' > > /// Jürgen > > > > On 02/19/2014 10:15 AM, Elias

[Bug-apl] Short pause of program

2014-02-19 Thread Elias Mårtenson
I've reached the point where I have been able to reproduce the famous Dyalog video where a guy builds a game of life and lets it animate by updating a watched variable, with one exception: I need a way to sleep for a short while (less than a second). Is there any facility in GNU APL that would let

Re: [Bug-apl] Short pause of program

2014-02-19 Thread Elias Mårtenson
Oh, I missed that one. Actually, I've been rebuilding the thing without watching the video. :-) Regards, Elias On 19 February 2014 22:17, Jay Foad wrote: > On 19 February 2014 14:05, Elias Mårtenson wrote: > > I've reached the point where I have been able to reproduce

[Bug-apl] Calling a function and assigning result corrupts result

2014-02-19 Thread Elias Mårtenson
This one is hard to explain, so I was about to attach a workspace that reproduces the error. However... As I tried to do a )SAVE to save the workspace, the interpreter crashed and of course I was editing functions directly in the workspace so they weren't saved. I'll rewrite it so I can show you.

Re: [Bug-apl] Bug when assigning variable to result of function call on self

2014-02-19 Thread Elias Mårtenson
Oops, I realise that I forgot to include the definition of disploop. Here it is: ∇N disploop S →(N=0)/0 next: S←next S disp ← '.#'[1+S] ⎕DL ÷4 N←N-1 →next ∇ Regards, Elias On 20 February 2014 01:01, Elias Mårtenson wrote: > As I mentioned previously, I've been playing a

[Bug-apl] Bug when assigning variable to result of function call on self

2014-02-19 Thread Elias Mårtenson
As I mentioned previously, I've been playing around with Game of Life, and I wrote my own. When I try to put this code in a loop, I get array corruption, and subsequently a crash (as I mentioned earlier) when I try to )SAVE the workspace. Here is the code. I start by creating a 5×5 field and initi

Re: [Bug-apl] Problems with shared variables

2014-02-20 Thread Elias Mårtenson
On 20 Feb 2014 18:57, "Kacper Gutowski" wrote: > > On 2014-02-16 18:09:06, Juergen Sauermann wrote: > > Ad 1) I changed the assertions Symbol.cc to short warnings visible in )MORE. > > I wouldn't guess to check )MORE upon getting VALUE ERROR on shared > variable, but I guess it's better than faile

Re: [Bug-apl] Problems with shared variables

2014-02-20 Thread Elias Mårtenson
> > /// Jürgen > > > > > On 02/20/2014 12:16 PM, Elias Mårtenson wrote: > > On 20 Feb 2014 18:57, "Kacper Gutowski" wrote: > > > > On 2014-02-16 18:09:06, Juergen Sauermann wrote: > > > Ad 1) I changed the assertions Symbol.cc to short warni

Re: [Bug-apl] Bug when assigning variable to result of function call on self

2014-02-20 Thread Elias Mårtenson
On 20 February 2014 17:24, Kacper Gutowski wrote: In this function, next is 2 (a label) rather than function you > defined earlier. So you literally have [3] S←2 S. Thank you. This explains the problem. Very silly of me. The crash when saving the resulting workspace should still be a bug thou

Re: [Bug-apl] Problems with shared variables

2014-02-24 Thread Elias Mårtenson
haven't done that yet, because I was not using )MORE in the beginning. > I'll add that. > > /// Jürgen > > > > > On 02/21/2014 03:47 AM, Elias Mårtenson wrote: > > Jürgen, > > I will put a check for )MORE availability in the end_input function and >

[Bug-apl] Execute with ◊ sometimes fails with LENGTH ERROR

2014-02-25 Thread Elias Mårtenson
The following statement works: *a←1 ◊ a←2 a ◊ a+2* 4 3 However, passed as an argument to ⍎, it fails: *⍎'a←1 ◊ a←2 a ◊ a+2'* LENGTH ERROR a+2 a←2 a a←1 ^^ If I change it slightly, it will not fail anymore, but I get the wrong result *⍎'a←1 ◊ a←2 a ◊ a'* 2 1 1 2

[Bug-apl] Generate random number between 0 and 1.

2014-02-25 Thread Elias Mårtenson
Dyalog has a way to generate a number between 0 and 1: ?0. This can be quite useful, and the workarounds without it are a bit ugly. Would it make sense to add this capability to GNU APL as well? Regards, Elias

[Bug-apl] Crash when forgetting to close lambda function

2014-02-25 Thread Elias Mårtenson
Very easy to reproduce this one. Simply type a single *{* character. This will crash GNU APL with the following stack trace: Token: 0x4C03001B { at Token.cc:490 (void *)get_Class(): '0x1b' at Token.cc:491 -- Stack trace at Token.cc:492

[Bug-apl] Regression: Lambda functions can no longer be assigned to a variable

2014-02-25 Thread Elias Mårtenson
This used to work a few versions back, now I'm just getting a SYNTAX ERROR: *foo ← {⍵}* SYNTAX ERROR foo←λ1 ^ ^ They still work as arguments to operators though: *{⍵+1}¨1 2 3* 2 3 4 Regards, Elias

[Bug-apl] Strange text corruption when sending a list to ⍞

2014-02-27 Thread Elias Mårtenson
When I type the following: *⍞←1,'x'* I get a strange result: 1#x Were # is a non-existing Unicode character (codepoint U+). Regards, Elias

[Bug-apl] Getting list of quad-commands and system commands

2014-03-01 Thread Elias Mårtenson
I've recently added smart expansion of symbols in the Emacs mode (press TAB and get a list of suggested variable and function names). I'd like it to be able to expand system commands and quad commands as well. Of course, I could simply hard-code the list of available commands, but it would be neate

Re: [Bug-apl] Getting list of quad-commands and system commands

2014-03-01 Thread Elias Mårtenson
Or #define > the macro as ID_ ## x (which gives an enum Id) and call id_name() on it > to get an UCS_string. > > /// Jürgen > > > > On 03/01/2014 02:42 PM, Elias Mårtenson wrote: > >> I've recently added smart expansion of symbols in the Emacs mode (press >> TA

Re: [Bug-apl] [Feature request] "]boxing on" analogue

2014-03-02 Thread Elias Mårtenson
Yay, an Emacs user. :-) I've been thinking of a feature that would display the result of the last interactive command in a separate buffer. Similar to the variable tracing that exists now, but for the return value of the last expression. One would have the ability to choose display format for this

[Bug-apl] Nested function definitions not working

2014-03-03 Thread Elias Mårtenson
I tried to define a tohex function that accepts multiple values: {{'0123456789abcdef'[⎕IO+(4⍴16)⊤⍵]}¨⍵} This results in the following: *tohex ← {{'0123456789abcdef'[⎕IO+(4⍴16)⊤⍵]}¨⍵}* SYNTAX ERROR However, splitting it up in two functions works fine: *tohex1 ← {'0123456789abcdef'[⎕

Re: [Bug-apl] D-fn binding leackage, Nested d-fns

2014-03-03 Thread Elias Mårtenson
I would like to suggest that the most convincing example is that of consistency. If { } can be used to wrap arbitrary APL code in an anonymous function, then it makes sense that you can also nest them. I'd also like to present my previous email as an example to a situation where I wanted nested lam

Re: [Bug-apl] [Feature request] "]boxing on" analogue

2014-03-03 Thread Elias Mårtenson
I second that thank you. This thing is awesome. :-) Regards, Elias On 3 March 2014 23:23, Daniel H. Leidisch wrote: > Hello! > > Juergen Sauermann > writes: > > > I have added command ]BOXING which takes an argument OFF, 2, 3, 4, 7, > > 8, or 9. > > See SVN 152. > > Great, thank you very much

Re: [Bug-apl] Getting list of quad-commands and system commands

2014-03-03 Thread Elias Mårtenson
, and those who need it are probably better off with a good > APL book. > > I wanted to wait with the next release until the rate of error reports > goes down a little. > Right now it seems to get a little more quiet, so maybe in two weeks from > now? > > /// Jürgen > >

[Bug-apl] Possible improvement to ]BOXING

2014-03-03 Thread Elias Mårtenson
I love ]BOXING and I'm using it all the time now. It's particularly useful when you're a beginner like myself. Would it be possible to prevent the application of the default ]BOXINGvalue when explicitly using ⎕CR? Consider this interaction? *]BOXING 8* *'foo' 'bar'* ┌→──┐ │┌→─

[Bug-apl] Rank operator and function assignment

2014-03-04 Thread Elias Mårtenson
I was playing around with the Rank Operator, which is something that isn't really documented in many places. I only saw references to it in the spec, while neither APL2 nor Dyalog mentions it. Now, there are a few things that behaves strangely, although it may be correct. First of all, the follow

[Bug-apl] Non-bug: Help comparing solutions

2014-03-04 Thread Elias Mårtenson
I was looking at the APL idiom libraryand found this solution to sort rows in a matrix X: A←(⍋,X)-⎕IO ◊ (⍴X)⍴(,X)[⎕IO+A[⍋⌊A÷¯1↑⍴X]] It looked a bit excessive to me, and I wanted to make a more clear version so I came up with this: ⊃p⌷¨⍨⊂¨⍋¨p←⊂[2]X Are t

Re: [Bug-apl] Non-bug: Help comparing solutions

2014-03-04 Thread Elias Mårtenson
s th ebest solution to this problem? Regards, Elias On 5 March 2014 13:06, Elias Mårtenson wrote: > I was looking at the APL idiom > library<http://aplwiki.com/FinnAplIdiomLibrary>and found this solution to > sort rows in a matrix X: > > A←(⍋,X)-⎕IO ◊ (⍴X)⍴(,X)[⎕IO+A[⍋⌊

Re: [Bug-apl] Non-bug: Help comparing solutions

2014-03-05 Thread Elias Mårtenson
On 5 March 2014 18:18, Jay Foad wrote: > > {⍵[⍋⍵]}⍤1 X > Nice. I feel stupid for not thinking of that. To me, it's clear that without the lambda functions, a lot of APL becomes unnecessarily cumbersome. Out of curiosity, do you have a good solution without the use of a lambda? "pure SO A

Re: [Bug-apl] Non-bug: Help comparing solutions

2014-03-05 Thread Elias Mårtenson
On 5 March 2014 19:12, Daniel H. Leidisch wrote: I don't think that the support for tacit programming in modern APL > implementations counts as "pure SO APL". :) Then again, I'm not sure > what "SO" means, assuming the "S" stands for standard. > Oh, you don't know what SO means? It's the interna

Re: [Bug-apl] Non-bug: Help comparing solutions

2014-03-05 Thread Elias Mårtenson
On 6 March 2014 08:01, Tobia Conforto wrote: > On 5 March 2014 19:12, Daniel H. Leidisch wrote: > > > Jokes aside, while I'm all in favor of such extensions for tacit > > programming (composition, currying, hooks/forks/trains, as in NARS2000, > > NGN, newer versions of Dyalog, J), I think proper

[Bug-apl] Suggestions needed: Editing of named lambdas

2014-03-05 Thread Elias Mårtenson
The Emacs mode allows the user to edit an existing function by pressing C-c C-f, or typing ∇ followed by the name of the function. This opens up the function editor in a separate window. However, when the user creates a function using the dfn notation: avg ← {(+/⍵)÷⍴⍵} And then tried to edit it

Re: [Bug-apl] Possible improvement to ]BOXING

2014-03-06 Thread Elias Mårtenson
Z←8 > ⎕CR xxx ◊ Z or > some ⎕CR returned by a function? > > /// Jürgen > > > > On 03/04/2014 05:35 AM, Elias Mårtenson wrote: > > I love ]BOXING and I'm using it all the time now. It's particularly > useful when you're a beginner like myself. &

Re: [Bug-apl] Getting list of quad-commands and system commands

2014-03-06 Thread Elias Mårtenson
It doesn't work correctly yet. SystemVariable.def doesn't give me all symbols. For example, ⎕DL is not included. How can I get those too? Regards, Elias On 4 March 2014 00:11, Elias Mårtenson wrote: > And it's done. There is now expansion of both system commands and quad

[Bug-apl] Implementation of ∩ - Intersection

2014-03-06 Thread Elias Mårtenson
Would it make sense to implement the ∩ function in GNU APL? In Dyalog, it represents the intersection function which returns the elements that occur in both L and R. Regards, Elias

Re: [Bug-apl] Suggestions needed: Editing of named lambdas

2014-03-06 Thread Elias Mårtenson
I think treating the lambdas just like any function is perfectly normal, and is exactly what any function languages does. Now, functional languages also has lexical closures, but I'm not sure how easy it would be to take advantage of it, since APL programs usually doesn't take advantage of clearly

[Bug-apl] Dyalog power operator, what does it do?

2014-03-07 Thread Elias Mårtenson
Can you guys tell me if I understand what the power operator actually does? The way I see it, it calls a function for a certain number of times, or until the function returns the same thing as its input. I made an implementation of it, to have something to experiment with. Can you guys tell me if

[Bug-apl] Getting fractional timestamps

2014-03-07 Thread Elias Mårtenson
The ⎕TS function is useful for getting the current time and date, but is there a function that can give me a simple timestamp as a single number (milliseconds from some epoch). I'm mainly interested in using this when benchmarking. I know I can play some games with the decode function, but the fac

[Bug-apl] Plus sign but no )MORE

2014-03-07 Thread Elias Mårtenson
If I type →2 on the prompt, I get an error message with a plus: SYNTAX ERROR+ But When I type )MORE, I get the answer: NO MORE ERROR INFO Is this correct? Regards, Elias

[Bug-apl] Common IO operations

2014-03-09 Thread Elias Mårtenson
A common need that I have is to be able to easily read and write data from/to files. For me, this data is usually in CSV form. Up until now, I've loaded them into Emacs and used my tools to push the tabular data into variables. However, it would be nicer to have something native in GNU APL itself.

[Bug-apl] Assertion error when typing ()

2014-03-09 Thread Elias Mårtenson
After some playing around, I just decided to type an opening and closing paren: *()* I then got the following error (trying again after restarting will not reproduce the error): Assertion failed: 0 in Function: init in file: Cell.cc:47 Call stack: ---

Re: [Bug-apl] Ideas for an online demo-version of GNU APl

2014-03-10 Thread Elias Mårtenson
I can set it up for testing purposes. I already have some servers available. Would it be possible to add a flag that enables "safe mode"? This would restrict the availability of shared variables and native functions? Regards, Elias On 10 Mar 2014 19:19, "Juergen Sauermann" wrote: > Hi Thomas, >

Re: [Bug-apl] Proposal for initial multicore support

2014-03-10 Thread Elias Mårtenson
This is something that I have been thinking about as well. And the thing that mostly concerns me is how multiple operations can be optimised. Part of that thinking is actually part of my idea to keep track of temporary objects so that they can be modified in-place. The core of that was already impl

Re: [Bug-apl] Proposal for initial multicore support

2014-03-10 Thread Elias Mårtenson
dmit that I haven't given more than passing thought to > consequences of intermediate results in the lambda. It might be useful > to think in terms of doing a parallel each only in the case where the > function is a composition of scalar functions. (That simplification > wou

Re: [Bug-apl] Experimental OpenMP patch

2014-03-11 Thread Elias Mårtenson
May I suggest that being able to choose the number of cores at runtime should actually be the default. Remember that most Linux distributions will not compile the source on the local machine and instead distributes binaries. Having some #ifdefs would be good, and having runtime user-selected (or a

Re: [Bug-apl] Experimental OpenMP patch

2014-03-11 Thread Elias Mårtenson
o avoid > too many changes later on. > > /// Jürgen > > > > On 03/11/2014 04:10 PM, Elias Mårtenson wrote: > > May I suggest that being able to choose the number of cores at runtime > should actually be the default. Remember that most Linux distributions will > not

Re: [Bug-apl] Experimental OpenMP patch

2014-03-11 Thread Elias Mårtenson
Oh and one more thing: Have you given any thought to my comments re. the coalescing of certain functions to reduce thread dispatch effort? (also, add some more functions to the no-copy optimisation?) Regards, Elias On 11 March 2014 23:22, Elias Mårtenson wrote: > I agree. I just wanted

[Bug-apl] "Largest integer" isnt' really largest?

2014-03-11 Thread Elias Mårtenson
Running ⎕SYL shows the following: largest integer 9223372036854775807 Trying to subtract one from this value gives a weird result: *9223372036854775807-1* ¯9223372036854775808 Regards, Elias

Re: [Bug-apl] "Largest integer" isnt' really largest?

2014-03-11 Thread Elias Mårtenson
There is also the option of adding another numeric type: bignum. This would probably take a lot of work though. On 12 Mar 2014 08:47, "Frederick H. Pitts" wrote: > Hello Kacper, > > Thanks for the explanation. > > I hope GnuAPL can be fixed so that accurate integer arithmetic can

Re: [Bug-apl] OpenMP performance: first result

2014-03-12 Thread Elias Mårtenson
I've done some experiments with Intel's Threading Building Blocks, and based on my initial tests, it seems incredibly light-weight, and also easy to use. I haven't tested with actual GNU APL code yet though (I've written separate test programs to experiment). My next tests will be on the real thin

Re: [Bug-apl] OpenMP performance: first result

2014-03-12 Thread Elias Mårtenson
regarding coalescing the jobs. Regards, Elias On 13 Mar 2014 00:03, "Elias Mårtenson" wrote: > I've done some experiments with Intel's Threading Building Blocks, and > based on my initial tests, it seems incredibly light-weight, and also easy > to use. > > I have

Re: [Bug-apl] GNU APL as javascript!

2014-03-14 Thread Elias Mårtenson
OK, that was pretty cool I must admit. I had no idea it was this capable. On 14 March 2014 15:38, Thomas Baruchel wrote: > I did it! > > First success > > A little hacky, but now I got the point I will make it better and better > in the weeks to come: > http://baruchel.hd.free.fr/apps/apl/ > >

Re: [Bug-apl] Building on OS X 10.8.5 Mountain Lion - SOLVED and How to setup your keyboard.

2014-03-14 Thread Elias Mårtenson
Do you think we could mention that the Emacs mode is available on the MELPA repository as well? This is so that they understand that they don't have to download it themselves. Regards, Elias On 14 March 2014 21:52, Juergen Sauermann wrote: > Hi Peter, > > my plan was to include your informatio

[Bug-apl] Performance optimisations: Results

2014-03-14 Thread Elias Mårtenson
Hello guys, I've spent some time experimenting with various performance optimisations and I would like to share my latest results with you: I've run a lot of tests using Callgrind, which is part of the Valgrindtool (documentation here

Re: [Bug-apl] Performance optimisations: Results

2014-03-14 Thread Elias Mårtenson
t using OpenMP is that there's no > hand-coding necessary. All you do is add #pragmas to your program; the > compiler takes care of the rewrites. > > > -- Forwarded message -- > >> From: "Elias Mårtenson" >> To: "bug-apl@gnu.org&qu

[Bug-apl] Merging of Emacs module native code

2014-03-15 Thread Elias Mårtenson
Hello Jürgen, Prior to the release of 1.3, could you merge the code for the native module from the Emacs mode? The code is pretty stable right now and ready for 1.3. Like last time, it's in the *native* branch of the Git repository: https://github.com/lokedhs/gnu-apl-mode/tree/native Regards, E

Re: [Bug-apl] segmentation fault with any use of quote-quad?

2014-03-18 Thread Elias Mårtenson
It works for me (and I'm sure I've used it in the past and never had a problem). Regards, Elias On 18 March 2014 22:40, wrote: > Hi, it looks like quote-quad ⍞ makes a segfault (any use seems to do it, > for instance: A←⍞ ). > > Regards, > > -- > Thomas Baruchel > >

[Bug-apl] Scan operator has strange behaviour

2014-03-19 Thread Elias Mårtenson
The following code returns the expected results: * {⍺+⍵}\⍳10* 1 3 6 10 15 21 28 36 45 55 However, if I also print all the calls, I get a lot more evaluations of the function than expected: *{(⍺+⍵)⊣⎕←('[',(⍕⍺),',',(⍕⍵),']')}\⍳10* [1,2] [2,3] [1,5] [3,4] [2,7] [1,9] [4,5] [3,9] [2,12]

[Bug-apl] How to zero every other 1 in a sequence

2014-03-19 Thread Elias Mårtenson
I've been struggling with this one for days now, and I really need some advice. Assume I have a binary sequence. Say, something like this: 0 0 1 1 0 0 1 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 Here, we can see a few sequences of consecutive ones. I want to zero out every second in each sequence. I.e,

Re: [Bug-apl] Scan operator has strange behaviour

2014-03-19 Thread Elias Mårtenson
I see. So the way I see it, I should actually use 2 *OP*/X instead? I seems to actually do what I expected. Regards, Elias On 19 March 2014 22:25, Kacper Gutowski wrote: > On 2014-03-19 21:22:04, Elias Mårtenson wrote: > > This can't possibly be correct? > > But it is!

Re: [Bug-apl] How to zero every other 1 in a sequence

2014-03-20 Thread Elias Mårtenson
One of my experiments was very short, and tantalisingly close to correct: ≠\V Unfortunately, it's not quite right. Does anyone have an idea how to coerce that one into being right? Regards, Elias On 20 March 2014 16:10, wrote: > Elias Mårtenson wrote: > > Assume I have a b

[Bug-apl] Segfault in assign_cellrefs

2014-03-21 Thread Elias Mårtenson
I was testing Kacpers solution to my problem in another thread, and I got a crash. Easily reproduced by typing in the following two commands: * V←1 2 2 1 2 2 2 1 2 2 2 2 1 2 2 2 2 2 1 3* * (V/V)←∊≠\¨V⊂V* The result is: ===

Re: [Bug-apl] Segfault in assign_cellrefs

2014-03-21 Thread Elias Mårtenson
fc625cbb0 0x47978a Regards, Elias On 21 March 2014 19:25, Elias Mårtenson wrote: > I was testing Kacpers solution to my problem in another thread, and I got > a crash. Easily reproduced by typing in the following two commands: > > * V←1 2 2 1 2

Re: [Bug-apl] How to zero every other 1 in a sequence

2014-03-21 Thread Elias Mårtenson
Wow. That really works. Pretty neat! (it does cause the interpreter to crash if you feed it unexpected (non-boolean) data though, :-) ) Regards, Elias On 21 March 2014 03:08, Kacper Gutowski wrote: > On 2014-03-21 00:23:41, Elias Mårtenson wrote: > > One of my experiments was very s

Re: [Bug-apl] Scan operator has strange behaviour

2014-03-21 Thread Elias Mårtenson
On 20 March 2014 11:31, Kacper Gutowski wrote: > On 2014-03-19 23:16:32, Elias Mårtenson wrote: > > I see. So the way I see it, I should actually use 2 OP/X instead? I > seems to > > actually do what I expected. > > It if does what you need then sure, but it's a ver

Re: [Bug-apl] Scan operator has strange behaviour

2014-03-21 Thread Elias Mårtenson
On 19 March 2014 22:25, Kacper Gutowski wrote: > On 2014-03-19 21:22:04, Elias Mårtenson wrote: > > This can't possibly be correct? > > But it is! > Let me just quote relevant excerpt of ISO 13751: > OK, I understand your explanation, and I have to say that the s

Re: [Bug-apl] Scan operator has strange behaviour

2014-03-21 Thread Elias Mårtenson
On 21 March 2014 19:55, Jay Foad wrote: > >\3 1 2 > 3 1 1 > > I think your explanation of scan would lead to the result 3 1 0. > > Associativity matters because the last item of the result is 3>1>2, > which means 3>(1>2). But your explanation would lead to (3>1)>2 as the > last item. > Yo

  1   2   3   4   5   6   7   8   9   10   >