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

2014-02-04 Thread Kacper Gutowski
On 2014-02-04 12:17:16, Elias Mårtenson wrote: When I look at the result from ,/1 2 3 it looks like an array that contains a single element: another array with the values 1 2 3 in it. But it isn't. Technically you aren't wrong at all, it IS an array that contains a single element. But

[Bug-apl] Problems with shared variables

2014-02-12 Thread Kacper Gutowski
Hello, There are multiple problems with shared variables facility. 1. Shared variable protocol is not safe in multi user environment. When user starts apl with shared variables enabled, it removes all other users' sessions from shared database as “stale” so currently even honest user without

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

2014-02-12 Thread Kacper Gutowski
On 2014-02-12 12:58:05, Elias Mårtenson wrote: The key feature that is needed is a way to be informed when a variable is changed. Shared variables have such feature. Though, it's probably not the right place for you too look in this case, as shared variables are whole separate name class and

Re: [Bug-apl] Unique of nested arrays doesn't work

2014-02-14 Thread Kacper Gutowski
On 2014-02-14 16:15:33, Juergen Sauermann wrote: fixed in SVN 120. In r122, it doesn't give domain error anymore, but I think that results are not correct: ⎕RL 1 8⎕CR Y←⊂[1]?2 10⍴2 ┌→──┐ │┌→──┐ ┌→──┐ ┌→──┐ ┌→──┐ ┌→──┐ ┌→──┐

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

2014-02-20 Thread Kacper Gutowski
On 2014-02-20 01:05:16, Elias Mårtenson wrote: ∇N disploop S →(N=0)/0 next: S←next S disp ← '.#'[1+S] ⎕DL ÷4 N←N-1 →next ∇ In this function, next is 2 (a label) rather than function you defined earlier. So you literally have [3] S←2 S. By the way,

Re: [Bug-apl] Problems with shared variables

2014-02-20 Thread Kacper Gutowski
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 failed assertion. Ad 3) hopefully fixed. I've mistakenly put

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

2014-03-11 Thread Kacper Gutowski
On 2014-03-11 17:29:08, Frederick H. Pitts wrote: If one executes i ← 0 63 1 ⍴ { ⍵ , i ← ¯1 + 2 × i + 1 }¨ 1 + ⍳ 63 one should get a 2-column table of bit count and corresponding maximum positive representable integer (assuming high order bit is a sign bit). The

Re: [Bug-apl] Finally turned javascript version to a true REPL interpreter

2014-03-31 Thread Kacper Gutowski
On 2014-03-30 20:50:31, baruc...@gmx.com wrote: At first glance, it seems to work: http://baruchel.hd.free.fr/apps/apl/i/ You can know use it as an online interpreter. I will add some colors/themes in the days to come, but the most difficult part is done. Great work! It's really nice to have

Re: [Bug-apl] Bug in function editing

2014-03-31 Thread Kacper Gutowski
On 2014-03-31 15:37:45, Elias Mårtenson wrote: Are you sure it's a bug? You seem to be taking the value of r when it has no value. I think the problem is that you can't edit a function that is currently on SI stack, not that Parse erred. -k

Re: [Bug-apl] Finally turned javascript version to a true REPL interpreter

2014-03-31 Thread Kacper Gutowski
On 2014-03-31 15:40:06, Elias Mårtenson wrote: The Nable editor should (in my opinion) open a separate editor just like the Emacs mode does. :-) That's one way to do things. But wouldn't it be nicer to just use something like )EDIT rather than hijacking ∇ for that purpose? I actually hated the

Re: [Bug-apl] is there a )copy ⎕fns like ⎕ex is )erase

2014-04-26 Thread Kacper Gutowski
On 2014-04-26 12:08:14, Juergen Sauermann wrote: I could make the ∇-editor aware that a )COPY is in progress and that functions shall be deleted automatically by the ∇-editor. I like a lot that there is now a command that sources another file raw, much like . in shell or #include in cpp. It's

Re: [Bug-apl] is there a )copy ⎕fns like ⎕ex is )erase

2014-04-26 Thread Kacper Gutowski
On 2014-04-26 21:15:43, Elias Mårtenson wrote: On 26 April 2014 20:52, Kacper Gutowski mwgam...@gmail.com wrote: ∇mean[0]   R←mean B   R←(+/B)÷⍴B ∇ This can be )COPY-ied many times without any problems as it enters the editor with a name only and then explicitly rewrites header line at [0

[Bug-apl] Segfault in PrintBuffer

2014-05-19 Thread Kacper Gutowski
Apparently, when array contains a big number that is to be displayed in exponential notation, the whole column containing it is printed with exponent. If array of mixed type has char and such big number in the same column, PrintBuffer segfaults on it: +X←?2 3 3⍴100 40 18 54 19 66 55 55 60

[Bug-apl] Segfault in outer product with empty argument

2014-05-19 Thread Kacper Gutowski
Outer product of any function with empty left or right argument, results in segmentation fault: 'abc' ∘.= '' SEGMENTATION FAULT -- Stack trace at main.cc:122

[Bug-apl] Assertion failure in scalar function with empty right argument

2014-05-19 Thread Kacper Gutowski
Thanks for previous two. Is it expected, by the way, that assert ends in a segfault? Isn't this also a bug? Anyway, any scalar function given empty right argument and non-conforming non-empty left argument misses check for shape equality: ⍬ = 1 2 LENGTH ERROR ⍬=1 2 ^^

[Bug-apl] Segmentation fault in zero take on scalar

2014-05-20 Thread Kacper Gutowski
0↑0 SEGMENTATION FAULT -- Stack trace at main.cc:122 0x7f81f5e43b45 __libc_start_main 0x4359b5 main 0x52a66d Workspace::immediate_execution(bool)

Re: [Bug-apl] Restrictions on localization of system variables?

2014-05-27 Thread Kacper Gutowski
On 2014-05-27 18:06:06, Juergen Sauermann wrote: Note that there are some subtle differences between IBM APL2 and GNU APL when localizing ⎕-vars. In IBM APL2 they are undefined after localizing them. In GNU APL they are pre-initialized with their respective default values. This gives simpler

[Bug-apl] Assertion failure in index with axis on vector

2014-06-04 Thread Kacper Gutowski
Hi, Using index with axis on a vector results in assertion failure. It works correctly with arrays of higher dimension or without axis. 1⌷[⎕IO]⍳1 == Assertion failed: IX.value_count() != 1 in Function: index

Re: [Bug-apl] Package Manager installation issues and proposal - feedback requested

2014-06-05 Thread Kacper Gutowski
On 2014-06-05 22:39:52, Elias Mårtenson wrote: May I also ask that after reading the main config file, the interpreter also reads $HOME/.gnu-apl.d for load user-level configuration. And finally, it should also check the commandline so that the paths can be overridden on a session-basis.

Re: [Bug-apl] Strange domain error

2014-06-10 Thread Kacper Gutowski
On 2014-06-10 14:08:47, Blake McBride wrote: It is funny because I call this function a lot.  Sometimes it works, other times it gives me the domain error.  Here are some more facts: DOMAIN ERROR Tmfmt[1]  z←(2 0⍕⍉d[,1;]),':',2 0⍕⍉(d←(2⍴100)⊤,d)[,2;]                               ^   ^    

Re: [Bug-apl] Identify function

2014-07-02 Thread Kacper Gutowski
On 2014-07-02 14:36:37, Juergen Sauermann wrote: I have added monadic ⊣ and ⊢ see SVN 355. Instead of making them identical I though it might be better to do different things. What I came up with is this: ⊢ B returns (a copy of) B as a normal APL value. ⊣ B also returns a copy of B, but

Re: [Bug-apl] Error building on OSX

2014-07-10 Thread Kacper Gutowski
On 2014-07-08 18:03:21, Juergen Sauermann wrote: SOL_SOCKET is 1 on linux but according to the man page of TCP(7) SOL_TCP (=6) should be used. I have changed the code to use he number 6 instead of SOL_TCP. SVN 368. Acctually, it should be IPPROTO_TCP as both mandated by POSIX and described in

Re: [Bug-apl] Formal format for function documentation

2014-07-13 Thread Kacper Gutowski
On 2014-07-14 00:01:13, Elias Mårtenson wrote: Most modern (and some not-so-modern) languages have a standard way of attaching documentation to functions and other symbols. (...) I think the most natural way to describe a function is simply by starting function *body* with a comment: ∇

Re: [Bug-apl] ⎕ES wrong message

2014-07-14 Thread Kacper Gutowski
Whoops, this thread was about the message rather than return value. About that, standard states that event-message is local to a context and that ⎕ES should create an exception in caller's context, but I don't think it's properly specified what does it exactly mean. But the point is, that ⎕ES

[Bug-apl] Equal incorrect for non-real arguments

2014-07-15 Thread Kacper Gutowski
When either of arguments of = has imaginary part of magnitude greater than comparison tolerance, a domain error is thrown. ⎕CT 1E¯13 0J1 = 0J1 DOMAIN ERROR 0J1=0J1 ^ ^ There are no conditions under which = is allowed to throw a domain error at all so this is serious.

Re: [Bug-apl] Equal incorrect for non-real arguments

2014-07-15 Thread Kacper Gutowski
On 2014-07-15 20:09:40, Juergen Sauermann wrote: Except that (not so obviously) : 1E¯15 = 1E¯14 0 Sorry, my mistake. You're, of course, right. Current (r376) behaviour seems to be correct with one exception: 1E¯15 = 1E¯14 0 1E¯15J0 = 1E¯14J0 1 Both should be zero,

Re: [Bug-apl] Determining data type...

2014-07-31 Thread Kacper Gutowski
On 2014-07-31 15:54:44, Peter Teeson wrote: Looked in the APL2 IBM manual but do not understand how to determine the data type of a variable. Neither the primitives nor the Quads sparked the answer in my brain. It must be something pretty obvious but not to me right now. So if I have a

[Bug-apl] Some typos

2014-08-02 Thread Kacper Gutowski
See below. As a side note, you might want to look at warnings that lintian gives for debian package even if most of them can be safely ingored. -k Index: workspaces/APL_CGI.apl === --- workspaces/APL_CGI.apl (revision 413) +++

Re: [Bug-apl] Power Operator

2014-08-13 Thread Kacper Gutowski
On 2014-08-13 19:42:25, Juergen Sauermann wrote: I believe the VALENCE ERROR comes because = is dyadic and the lambda is monadic? In GNU APL (and in the ISO standard) there is no monadic =, is it? Maybe in Dyalog APL there is? No, it was supposed to be dyadic. I'm not sure how GNU APL

[Bug-apl] Segfault in empty replicate-assignment

2014-08-14 Thread Kacper Gutowski
(⍬/X)←⍬ ⊣ X←⍬ SEGMENTATION FAULT -- Stack trace at main.cc:140 0x7f4f289fbb45 __libc_start_main 0x43b725 main 0x556c75

[Bug-apl] Assertion failure after indexing ⍺ or ⍵

2014-08-16 Thread Kacper Gutowski
{1=⍵} ,1 1 {1=⍵[1]} ,1 1 {⍵=1} ,1 1 {⍵[1]=1} ,1 == Assertion failed: Avec::is_quad(idname[0]) in Function: get_nc in file: NamedObject.cc:42 Call stack:

[Bug-apl] Bad quality of the roll function

2014-08-19 Thread Kacper Gutowski
Currently GNU APL uses LCG with modulus 2⋆64 and then reduces values modulo desired range. This, beside being slightly biased for ranges not dividing the modulus, yields reduced periods when range is power of two. ?10 16⍴16 11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8 11 2 13 12 15 6 1 16 3 10

Re: [Bug-apl] Bad quality of the roll function

2014-08-21 Thread Kacper Gutowski
I don't think there is anything to gain by changing the main LCG part given the constraints. I don't know how good are the parameters used by GNU APL but they should be okay since those are the ones proposed by Knuth. LCGs have a number of well known weaknesses, one of which is that their less

Re: [Bug-apl] Bad quality of the roll function

2014-08-21 Thread Kacper Gutowski
Oh, I see you already fixed the bias exatly the way I wanted you to in r440 even before I posted that :) I still recommend using xorshift premutation instead of bit reversal and iterating ⎕RL only once per output value. -k

[Bug-apl] Segfault in reshape

2014-10-12 Thread Kacper Gutowski
When used with negative shape as left argument and non-literal array on the right, reshape dies with segmentation fault instead of raising a DOMAIN ERROR. ¯1⍴0,0 SEGMENTATION FAULT -- Stack

[Bug-apl] segfault when using dyadic rank with empty arrays

2014-12-02 Thread Kacper Gutowski
1↑⍤0 ⍬ SEGMENTATION FAULT thread: 0x7fb6c6ec2740 thread_contexts_count: 1 busy_worker_count: 0 active_core_count: 1 thread # 0: 0x7fb6c6ec2740 pool sema: 0 RUN job: 0 no-name --

Re: [Bug-apl] Something is wrong here (or I may be wrong myself)

2015-04-25 Thread Kacper Gutowski
On Sat, Apr 25, 2015 at 4:38 AM, Christian Robert christian.rob...@polymtl.ca wrote: a←1 0 0 0 0 1 0 0 1 1 0 0 1 1 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 b← 26 27 28 a[b] 0 0 0 b⊃a DOMAIN ERROR b⊃a ^ ^ I think this should be rank error rather than domain

Re: [Bug-apl] using XFRPC11.w3

2015-04-24 Thread Kacper Gutowski
On Fri, Apr 24, 2015 at 7:23 PM, Juergen Sauermann juergen.sauerm...@t-online.de wrote: Now, ATF files are what )IN and )OUT read resp, produce. Chances are that those ATF files are the same as for IBM APL2. In that case all you need is to write them in Dyalog and read them back into GNU APL

Re: [Bug-apl] SVN 585 clean build

2015-04-02 Thread Kacper Gutowski
I just checked out 592 and it failed to build because of missing buildtag.hh. Apparently this is just a typo in configure: cd src source ./buildtag ; cd .. Missing . -k

Re: [Bug-apl] segmentation fault in svn 639

2015-06-20 Thread Kacper Gutowski
On Sat, Jun 20, 2015 at 12:32 PM, Louis Chretien lchret...@mac.com wrote: I agree the error message should not be as dire as a segfault, but the basic intent seems dubious… There's nothing inherently wrong with this. Argument of ⎕EX should be a character array with rows containing identifiers

[Bug-apl] Circle bugs

2015-06-29 Thread Kacper Gutowski
There is a number of problems with circle functions. Inverse trigonometric and hyperbolic functions ¯1 ¯2 ¯6 ¯7 as well as function 0 are not properly extended to complex values when given argument is real; they work correctly with real-valued complex cells: 0 ¯1 ¯2 ¯6 ¯7 ∘.○ ¯2 ¯2J0

[Bug-apl] Unexpected domain error in power

2015-06-29 Thread Kacper Gutowski
I have no idea how that happens. ¯1J0⋆2 DOMAIN ERROR ¯1⋆2 ^ ^ -k

Re: [Bug-apl] Conversion from APL2000 to Gnu APL

2015-10-22 Thread Kacper Gutowski
On Thu, Oct 22, 2015 at 3:29 PM, Michael Potter wrote: > APL2000 does not appear to have an )OUT command. > > We get: > "INCORRECT COMMAND" in response to: > )OUT > )OUT SOMEFILE > )OUT C:SOMEFILE I think in APL2000 it should be ]OUT starting with square bracket. At least

Re: [Bug-apl] ⎕TRACE usage ?

2015-10-22 Thread Kacper Gutowski
On Fri, Oct 23, 2015 at 5:45 AM, wrote: > Is there documentation on how to use ⎕TRACE ? I ran info apl | grep ⎕TRACE > and found nothing. It does not look like it is listed in the IBM APL2 manual > either. ⎕STOP and ⎕TRACE are defined in ISO 13751. They are part of

Re: [Bug-apl] Segfault when tracing not a function

2015-10-23 Thread Kacper Gutowski
--- src/QuadFunction.cc (revision 686) +++ src/QuadFunction.cc (working copy) @@ -1604,7 +1604,7 @@ } Function * fun = fun_symbol->get_function(); - if (fun_symbol == 0) + if (fun == 0) { CERR << "symbol " << fun_name_ucs << " is not a function" << endl;

Re: [Bug-apl] Help using the power operator

2015-10-30 Thread Kacper Gutowski
On Fri, Oct 30, 2015 at 11:01 AM, Elias Mårtenson wrote: > > 4×+/{(¯1*⍵+1)÷¯1+2×⍵}¨⍳100 > > The above expression performs 1 million iterations, but is also allocates a > 1 million element array to do so. I don't know GNU APL internals well enough to speak about when

Re: [Bug-apl] Help using the power operator

2015-10-30 Thread Kacper Gutowski
On Fri, Oct 30, 2015 at 2:39 PM, Kacper Gutowski <mwgam...@gmail.com> wrote: > i←0 ◊ 4×{⍵+(¯1*i+1)÷¯1+2×i←i+1}⍣100⊢0 This is slightly faster and doesn't use global variables: ↑{(+/⍵[1],4÷1↓⍵),4 ¯4+1↓⍵}⍣50⊢0 1 ¯3 Nowhere near “simple and natural,” though. -k

Re: [Bug-apl] How do you handle the contents of POST in a CGI script

2015-10-12 Thread Kacper Gutowski
On Mon, Oct 12, 2015 at 5:48 AM, wrote: > Why do you choose to write it like this?: > ContentsOfPOST←{⍵, FIO∆fread 0}⍣{⍺⊢FIO∆feof 0}'' > > This method (in my limited knowledge) seems equivalent: > ContentsOfPOST←(FIO∆feof 0) FIO∆fread 0 I don't think it is. FIO∆fread

Re: [Bug-apl] How do you handle the contents of POST in a CGI script

2015-10-09 Thread Kacper Gutowski
On Sat, Oct 10, 2015 at 3:29 AM, wrote: > I am struggling to follow our previous conversation. Pretty much, I am > confused about the source of the POST contents. I believe you mentioned that > it should come from stdin, and if I understood, it is not possible to use

Re: [Bug-apl] take and drop on matrixes?

2015-08-29 Thread Kacper Gutowski
On Sun, Aug 30, 2015 at 12:02 AM, Alexey Veretennikov alexey.veretenni...@gmail.com wrote: Thanks, it looks indeed like I have to specify all sizes in GNU APL. In Dyalog you can use Dyalog's extensions to the standard but in GNU APL, you can use GNU APL's extensions. You don't need to specify

Re: [Bug-apl] APL Questions

2015-09-14 Thread Kacper Gutowski
On Sun, Sep 13, 2015 at 11:53 PM, Louis de Forcrand wrote: > Is it possible to terminate a function while it's running > (eg. when you accidentally set a very large number > as an operand)? Pressing Control-C should signal ATTENTION which should suspend execution of current

[Bug-apl] ⎕INP ignores parts of its input (Re: she bang script arguments)

2016-06-01 Thread Kacper Gutowski
I came up with this silly variant of APL-in-shell embedding: #!/bin/sh true ←⎕inp'#' exec apl --script "$0" -- ${1+"$@"} # )erase true But I think there's something wrong with ⎕INP, actually. In the example above, true is ⍬ (sic) just before erasing. ]BOXING 8 ⎕INP "E" AE

Re: [Bug-apl] trunk/support-files/Dyalog-Keyboard/apl.xmodmap alt+tab

2016-01-15 Thread Kacper Gutowski
On Fri, Jan 15, 2016 at 4:29 AM, wrote: > I was wondering if anyone is familiar enough with xmodmap to know why it > would disable the existing Alt-Tab functionality in xorg (switching between > windows) when the key combination has no apparent use in the interpreter.

Re: [Bug-apl] apl symbols from a file

2016-02-14 Thread Kacper Gutowski
On Mon, Feb 15, 2016 at 12:08 AM, wrote: > the system's word count mechanism says length four. APL says length three, I > thought this was going to be length 1 and the symbol '⍝'. Does anyone know > what I am doing incorrectly: > > a@a:~/aplstuff$ echo "⍝" > txt >

Re: [Bug-apl] noise in fomatting ver small numbers

2016-02-21 Thread Kacper Gutowski
On Sun, Feb 21, 2016 at 10:38 PM, wrote: > it seems that format adds fuzz after a certain point. It's not a “fuzz,” but an artifact of using IEEE 754 double precision floating point numbers. ISO APL leaves a lot of freedom when it comes to representation of numbers,

Re: [Bug-apl] Feature suggestion: multiple function arguments

2016-03-13 Thread Kacper Gutowski
On Sun, Mar 13, 2016 at 6:20 PM, Juergen Sauermann wrote: > it actually does create conflicts. > > In IBM APL2 and in GNU APL, the expression > > ⍺ (f g h) ⍵ > > gives a 3 item vector with the items being ⍺, (f g h), and ⍵. > In Dyalog APL it gives (quote): > > (⍺ f

Re: [Bug-apl] Feature suggestion: multiple function arguments

2016-03-15 Thread Kacper Gutowski
On Mon, Mar 14, 2016 at 2:03 PM, Juergen Sauermann wrote: > Consider this: > > 1 (+//) 1 2 3 4 > 1 2 3 4 FWIW, Dyalog returns the same, but it certainly does something weird I don't understand here. It treats it as an operator even when it says it is a function: f←/ ⎕NC'f' 3

[Bug-apl] Incorrect logarithm of negative real numbers

2016-03-15 Thread Kacper Gutowski
Logarithm of negative real number fails to coerce it to complex and results in a malformed value: 2⍟¯1 0.0 2⍟¯1J0 0J4.532360142 -k

[Bug-apl] Segfault in 5⎕CR and 6⎕CR

2016-03-30 Thread Kacper Gutowski
Dyadic ⎕CR with 5 or 6 as its left argument and character scalar instead of vector as right causes segmentation fault: 5⎕CR '1' SEGMENTATION FAULT -- Stack trace at main.cc:63

Re: [Bug-apl] Error handling and IO

2016-04-11 Thread Kacper Gutowski
If I understand correctly, Elias wants to have something that would ensure that every file opened is eventually closed (only more general so it can be applied to any external resources not only files). That is in a code similar to the following, to ensure the line 3 is always run even if there's

[Bug-apl] ⎕SQQ

2016-04-09 Thread Kacper Gutowski
Hi, Currently GNU APL doesn't know what ⎕SVQ is because it became ⎕SQQ due to typo back in r625. ⎕SVQ'' VALUE ERROR ⎕ SVQ '' Amusingly: ⎕SQQ SYNTAX ERROR ⎕SVQ ^ -k

Re: [Bug-apl] Error handling and IO

2016-04-11 Thread Kacper Gutowski
On Mon, Apr 11, 2016 at 5:27 AM, Elias Mårtenson wrote: > This seems similar to what GNU APL provides with the ⎕EA feature. The > problem with this (and, as far as I can tell, also with this Dyalog feature) > is that in an error handler, the original error has disappeared. If you call some

Re: [Bug-apl] Near Proof of concept of an )edit somefunction_name

2016-03-19 Thread Kacper Gutowski
I recall there being some similar attempts presented on this list but I couldn't find working example so I hacked up the following. It has few rough edges and wasn't tested thoroughly but appears to work. ]USERCMD ]EDIT EDIT⍙ 1 ∇S EDIT⍙ Q;FN;FD ⍝ Edit a function or operator in external

[Bug-apl] 19⎕CR prints stack trace for bad UTF-8

2016-03-19 Thread Kacper Gutowski
Giving malformed string to 19⎕CR results in it printing an error message and a stack trace, and then returning an empty vector. As it's generally very useful to have generic routine parsing UTF-8 data at hand, I think it shouldn't do that. If it's an error, it should be possible to handle it

[Bug-apl] Error in ⎕EC with each operator

2016-03-19 Thread Kacper Gutowski
⎕EC¨ returns the expected 3-element vector only for the first element of ravel list of its argument and plain values for others. If they return no values, it fails; if they err, the interpreter hangs. ]boxing 7 {⎕EC⍵}¨'12' ┌→──┐ ┌→──┐ │1 ┌→──┐ ┌─┐│ │1 ┌→──┐ ┌─┐│ │ │0

Re: [Bug-apl] Error in ⎕EC with each operator

2016-03-23 Thread Kacper Gutowski
Looks like “Bad number” is a different kind of error than other syntax errors. If, say, lone ¯ is evaluated in ⎕EC¨ last then it seems to abort the whole line ⎕EC¨ appears in. I'm at r712. ⎕EC¨'1¯' ⍝ no result at all ⎕FX'f x' '⊣ ⎕EC¨x' f f'1¯' ⍝ unexpected output 1 0 0 1

Re: [Bug-apl] Error in ⎕EC with each operator

2016-03-20 Thread Kacper Gutowski
> > On 03/20/2016 01:29 AM, Kacper Gutowski wrote: >> >> ⎕EC¨ returns the expected 3-element vector only for the first element >> of ravel list of its argument and plain values for others. If they >> return no values, it fails; if they err, the inter

Re: [Bug-apl] IOTA

2016-03-03 Thread Kacper Gutowski
On Thu, Mar 3, 2016 at 12:40 PM, Juergen Sauermann wrote: > the IBM APL2 language reference says (page 111): > > If R is a simple scalar, ⊂ R is R. If R is not a simple scalar, the depth of > R is 1+ ≡R. > > And the ISO standard says the same (page 169): > > Z ← ⊂B

Re: [Bug-apl] ⎕fio

2016-03-05 Thread Kacper Gutowski
On Sat, Mar 5, 2016 at 6:45 AM, Christian Robert wrote: > [0] z←Execute cmd;⎕io;fh > [7] Fini: ⎕FIO[25] fh > [8] ⊃⊃z (...) > I do not understand why it repeat the result twice. one via stdout and one > via boxing as I can guess. The function returns z as

Re: [Bug-apl] The Dyalog ⌸ operator

2016-04-26 Thread Kacper Gutowski
On Wed, Apr 27, 2016 at 5:02 AM, Elias Mårtenson wrote: > So, I wanted to simply take a string of characters, and create a list of > each character and the number of occurrences of each character in that > string. Indeed it could be written in Dyalog very succinctly as ⊣,∘≢⌸ but I would write it

Re: [Bug-apl] RNG

2016-05-18 Thread Kacper Gutowski
On Thu, May 19, 2016 at 12:37 AM, Xiao-Yong Jin wrote: > Now, > (22⍴8)⊤2⊥63⍴1 > 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > Dyalog does the same thing. > Can someone please explain to me why? Because the result of ⊥ doesn't fit into integer and it gets converted to a floating point

Re: [Bug-apl] Outer product with replicate error

2016-05-17 Thread Kacper Gutowski
On Tue, May 17, 2016 at 4:49 PM, Juergen Sauermann wrote: > is seems like IBM APL2 computes > 1 2 3 /¨ 4 5 6 > as: > (1 2 3/4) (1 2 3/5) (1 2 3/6) > However, the ISO standard says > Z ← A f¨ B (...) The difference isn't in each operator, but in parsing / always as a monadic operator

Re: [Bug-apl] RNG

2016-05-18 Thread Kacper Gutowski
On Wed, May 18, 2016 at 5:09 PM, Xiao-Yong Jin wrote: (...) > relying on ¯1=2⊥64⍴1 (always a 64-bit signed integer), for which Dyalog > does differently. I think this is a bug. -k

Re: [Bug-apl] Stack trace in, maybe, Rank Operator

2016-05-02 Thread Kacper Gutowski
This assertion can be still made false in r725 with: +⍤1 ⍬ == Assertion failed: 0 in Function: init in file: Cell.cc:48 Call stack: -- Stack trace at

Re: [Bug-apl] fractional power ¯8⋆÷3

2016-04-13 Thread Kacper Gutowski
On Thu, Apr 14, 2016 at 1:54 AM, Xiao-Yong Jin wrote: > Exactly so. ‘-Ofast -fno-finite-math-only’ gives correct results. > What’s going on here? I don’t expect this has anything to do with NaN or Inf. pow(-8., 1./3) is nan. And -ffinite-math-only eliminates isfinite check at FloatCell.cc:422.

[Bug-apl] Error in rank with each

2016-07-12 Thread Kacper Gutowski
⊂⍤¯1¨0 result: 'SI_PUSHED' at Bif_OPER1_EACH.cc:257 -- Stack trace at Bif_OPER1_EACH.cc:257 0x7fa8af92d5f0 __libc_start_main 0x444ae5 main 0x58069d Workspace::immediate_execution(bool) 0x48a852

[Bug-apl] 0⍟0

2016-07-12 Thread Kacper Gutowski
According to ISO, 0⍟0 should be one. GNU APL gives: 0⍟0 DOMAIN ERROR 0⍟0 ^^ -k

Re: [Bug-apl] AM_MAKEFLAGS = -j 4

2016-07-29 Thread Kacper Gutowski
On 29 July 2016 at 16:08, Juergen Sauermann wrote: > unfortunately it is not that easy. make does not pass its -j option to > sub-makes. I don't know if it works as documented, I never checked it, but according to GNU make manual, it should coordinate between sub-makes to run the number of tasks

Re: [Bug-apl] A couple of bugs, and a question on the power operator

2016-08-13 Thread Kacper Gutowski
I like the second of the proposed solutions. Since ambivalent function can always be called monadically, I think that making the header of d-fns always λ←⍺ λ1 ⍵ regardless of whether ⍺ occurs in the body or not, shouldn't break anything and would only make a language a bit simpler. Although maybe

Re: [Bug-apl] Error parsing lambdas in FX

2016-07-12 Thread Kacper Gutowski
I just got this at r775: {'⍝'} copying: '1' at Executable.cc:655 tidx:'1' at Executable.cc:655 -- Stack trace at Executable.cc:655 0x7f055ac095f0 __libc_start_main 0x444ae5 main

Re: [Bug-apl] 0⍟0

2016-07-13 Thread Kacper Gutowski
On 13 July 2016 at 13:21, Juergen Sauermann wrote: > I see. Which leaves the question if "equal" shall be strict or within ⎕IO. > > Since we are dealing with real numbers (and therefore often rounding errors) > within ⎕IO > makes more sense to me but the standard does not mention ⎕IO for ⍟. I

Re: [Bug-apl] 0⍟0

2016-07-13 Thread Kacper Gutowski
On 13 July 2016 at 12:04, Juergen Sauermann wrote: > my ISO (June 9, 2000) says DOMAIN ERROR. I'm using the PDF that was linked from GNU APL documentation, that is, exactly the same Jun 2000 version. > If A and B are equal, return one. As Jay just have written, the evaluation sequence in section

[Bug-apl] Error parsing lambdas in FX

2016-07-09 Thread Kacper Gutowski
I commented out a line of code and suddenly GNU APL exited when FX-ing it. Looks like it hit some not-implemented-yet part, but could you please make FIXME exit with non-zero exit code? ⎕FX 'F' '⍝}' '{{}}' copying: '0' at Executable.cc:655 tidx:'2' at

Re: [Bug-apl] APL & AKT in xterm

2016-08-03 Thread Kacper Gutowski
On Wed, Aug 03, 2016 at 07:09:38PM -0500, Blake McBride wrote: > APL with AKT works great. But now I need to use it in an xterm. Doesn't > seem to work there. Any suggestions would be greatly appreciated. You need to set metaSendsEscape. It can be configured in X resource or switched in run

Re: [Bug-apl] Silence the )copy command

2017-02-03 Thread Kacper Gutowski
On 3 February 2017 at 20:31, Alexey Veretennikov wrote: > How can I silence this output when I execute the )copy command from the > script? You can do ⊣⍎')COPY 5 FILE_IO FIO∆errno' -k

Re: [Bug-apl] ⎕FIO[49]

2017-01-24 Thread Kacper Gutowski
On 25 January 2017 at 05:54, Elias Mårtenson wrote: > Is there anything inherently wrong with having more quad-commands? What is > the reason we have to do ⎕FIO[49] instead of simply ⎕ReadLines or something > like that? > > It's like we're going out of way to make code unreadable. I know APL is

[Bug-apl] Sqlite provider truncates integers in results

2017-02-12 Thread Kacper Gutowski
The sqlite provider seems to silently truncate integer values in results: )COPY 5 SQL DUMPED 2017-02-12 10:13:53 (GMT+1) db←'sqlite' SQL∆Connect ':memory:' 'create table a(b)' SQL∆Exec[db] ⍬ 'insert into a values(?),(?)' SQL∆Exec[db] 2⋆31 32 'select b from a'

Re: [Bug-apl] Sqlite provider truncates integers in results

2017-02-14 Thread Kacper Gutowski
On 14 February 2017 at 14:31, Elias Mårtenson wrote: > I've taken a look at this now, and I believe this patch should fix your > problem. Please try it, and I'd like to ask Jürgen to merge it. Yes, this fixes it. Thanks. -k

Re: [Bug-apl] AP100 problem

2017-02-15 Thread Kacper Gutowski
On 15 February 2017 at 03:59, Frederick Pitts wrote: > But the problem does seem specific to my platform. I can reproduce it under debian testing. It appears that strings longer than 12 are somehow misinterpreted by AP100 and garbage is sent to popen. It doesn't seem to have anything to do with

Re: [Bug-apl] Spell corrector - APL

2016-09-09 Thread Kacper Gutowski
On 9 September 2016 at 23:39, Ala'a Mohammad wrote: > the errors happened inside 'hist' function, and I presume mostly due > to the jot dot find (if understand correctly, operating on a matrix of > length equal to : unique-length * words-length) Try (∪⍵)∘.≡⍵ instead of ∨/¨(∪⍵)∘.⍷⍵. -k

Re: [Bug-apl] Nil result from ⌹

2016-08-28 Thread Kacper Gutowski
On 28 August 2016 at 04:12, enztec wrote: > works here Perhaps it would fail if you tried bigger array? 9 seemed enough to reproduce it reliably in my environment. And no, this is a complete transcript, nothing else was defined. -k

[Bug-apl] Nil result from ⌹

2016-08-27 Thread Kacper Gutowski
Hi, Matrix division returns no value for large-shaped arguments. There doesn't seem to be any fixed threshold above which it fails, it differs from case to case. A←?9 3⍴256 X←A⌹A X VALUE ERROR X ^ -k

Re: [Bug-apl] Nil result from ⌹

2016-08-28 Thread Kacper Gutowski
On 28 August 2016 at 14:02, Juergen Sauermann wrote: > I believe I managed to reduce the amount of memory needed for A⌹B > considerably. SVN 791. Great! Thanks. -k

Re: [Bug-apl] Exercise on ⎕ts.

2017-01-12 Thread Kacper Gutowski
Actually, disregard that. It's just: '0006-06-06@06:06:06.000'⍕⎕TS 2017-01-12@10:42:39.088 Formatting dates is literally what was used as an example of using formatting code 6 in apl2lrm. -k

Re: [Bug-apl] Calling external editor from APL session

2016-12-20 Thread Kacper Gutowski
On Tue, Dec 20, 2016 at 10:30:14AM +0100, Alexey Veretennikov wrote: > Using )HOST Vim complains "Vim: Warning: Output is not to a terminal" > and not really useful (can't see what I type for instance). > Same if I use popen() via ⎕FIO. )HOST and popen are essentially the same thing and they both

Re: [Bug-apl] How to set the screen width in APL interpreter

2016-12-23 Thread Kacper Gutowski
On Sat, Dec 24, 2016 at 12:14:41AM +0100, Alexey Veretennikov wrote: > I'm running GNU APL in the X terminal with geometry 48x15 (it is a small > screen). How could I set this width(48) to the GNU APL interpreter so it > will behave correctly on deletion of characters in long lines etc? Setting

Re: [Bug-apl] ⎕PW handling

2016-12-26 Thread Kacper Gutowski
On 26 December 2016 at 20:09, Juergen Sauermann wrote: > Kacper: you can now enable change of ⎕PW via the WINCH signal. This may not > work on all platforms, therefore is has to be enabled in one of your > preferences files. Works great, thanks. It's okay that it requires enabling, it's not

[Bug-apl] Domain error in grade up/down with near-reals

2016-12-16 Thread Kacper Gutowski
Hello, There is another case of not handling near-real numbers properly: ⍋,1J0 DOMAIN ERROR ⍋,1 ^^ It should of course return ,1. -k

[Bug-apl] Invalid value in binomial

2016-12-16 Thread Kacper Gutowski
Hello, Binomial returns malformed result when called with some non-integer arguments: 0!200.1 0.0 -k

Re: [Bug-apl] Invalid value in binomial

2016-12-16 Thread Kacper Gutowski
On Fri, Dec 16, 2016 at 11:43:19AM +0100, Nick Lobachevsky wrote: > Wouldn't this really be a domain error, the maximum argument value for > ! being around 170? > > !170 > 7.257415615307994E306 > !171 > DOMAIN ERROR I'm using dyadic ! here so it should return 1 nevertheless; it does

  1   2   >