« first day (1501 days earlier)      last day (1154 days later) » 

8:00 PM
that's odd
 
ngn
"subject" :)
 
oh wait you have the rotate ( for joining data
 
And the name and value have to have the same role in assignment, so for most large expressions you can tell the final type immediately.
@nathanrogers And you get to not panic and look rightward every time you apply a function with rank 1.
 
@ngn it's quite similar, but either a font or coloring fix that
and speaking of coloring, if one wanted to, syntax-highlighting for BQN could color parentheses by whether they group an array, function, 1-modifier or 2-modifier. (but i don't think that's particularly useful)
 
@dzaima I think it's useful but it would be very hard to get any editor to do it.
 
ngn
8:04 PM
@dzaima mumbles: why have the problem and fix the problem instead of not having the problem in the first place..
^this is a common theme here
 
@ngn there aren't many other options - there aren't (m)any other usable paired unicode characters, and not having array notation is also stupid
 
@dzaima I use lisp, and paredit makes telling which scope you're in really easy through colored parens
 
ngn
@dzaima is (a⋄b) meaningful in bqn?
 
@ngn No, it's banned.
 
@Marshall anything that allows coloring things by non-context-free rules should easily allow for it (though i don't know what, if any, of such cases would be; and i also might or might not at some point make my own editor too so ¯\_(ツ)_/¯ (though i'm at the "might or might not" stage of way too many things))
@ngn but (a) wouldn't be a single-item list then, and that's stupid
 
ngn
8:08 PM
@Marshall @dzaima there you go. why not make that the array notation?
@dzaima (⋄a) or something.. there are ways
 
@ngn Because being able to write one-element lists is very important.
 
@ngn that's just ugly
 
ngn
no uglier than that thing that looks like the illegitimate child of < and (
 
@ngn imo it is less ugly
 
can someone help me find another way to determine if all substrings are part of a string?
('ac' 'cd' 'pq' 'xy')∨.∊⊂'accdpqxy'
 
8:10 PM
@nathanrogers wouldn't you want instead of there?
 
     ('ac' 'cd' 'pq' 'xy')∨.⍷⊂'accdpqxy'
┌───────────────┐
│1 0 1 0 1 0 1 0│
└───────────────┘
 
@nathanrogers you still want the reduction - ∨.(∨/⍷)⊂
 
oh, so I was right
thanks. I never can remember the difference between ∊ and ⍷
 
ngn
@Marshall you must have a primitive for making a 1-element list?
 
∨/ a ∨/⍤⍷¨ ⊂b is an alternative
@ngn for some reason, Marshall decided to not. I still definitely want one
 
ngn
8:13 PM
oh.. i was going to suggest (thatprimitive ..) as the obvious solution
 
and (a⋄b⋄c) (a⋄b) ⍮a (or whatever) isn't a nice progression either
 
@ngn I can't find a good glyph to use. But it is absolutely not okay that you would delete an item from a literal two-element list and not end up with a literal one-element list. So it's not really relevant.
≍○< is the standard function to make a list of one or two arguments.
 
ngn
@Marshall 0_0 that's a 2-element list, right? (imagine the _ is curved)
 
@ngn the thing being that the creation and solving of a given thing you're whining about also solves something else (that you don't care about, but others do)
 
ngn
@dzaima right. i whine about many things. it's a matter of deciding which is more important. like in real life.
 
8:17 PM
@ngn Stranding does have that issue, but the programmer can think about whether they're likely to change the number of elements and decide whether to use it. There has to be some option that adapts gracefully to all cases though.
 
@ngn I'm not exactly a fan of -notation, but the alternatives aren't good (always using ⟨⟩-or-whatever-notation is a lot of overhead, and k-style array tokens and APL strands both make for weird syntactic things)
 
trying to look at the tree for this guy
(3≤+/,∊'aeiou')
but I get DOMAIN ERROR
 
ngn
@nathanrogers "the tree"?
 
um... I'm trying to evalute it
and get the representation
yes
 
@ngn creating and solving a problem, "in real life", is net zero. If doing that also solves another problem, it's a net positive.
 
ngn
8:26 PM
@nathanrogers , and are no-ops there. so, you're trying to sum a string.
 
well
i'd like to understand why it won't even evaluate to show me the representation at least
 
@nathanrogers representation of what?
 
it doesn't look like completely invalid APL
the train
come on
 
@nathanrogers there's no trains here
 
      (+/÷≢)
┌─────┬─┬─┐
│┌─┬─┐│÷│≢│
││+│/││ │ │
│└─┴─┘│ │ │
└─────┴─┴─┘
yes the representation
 
8:28 PM
@nathanrogers right, that's a train. (3≤+/,∊'aeiou') isn't a train
 
right
I understand that
but it isn't parseable?
 
@nathanrogers it's "parseable", but entering a line in the Dyalog REPL executes it, not gives you a parse tree (which isn't even a thing in Dyalog)
 
domain error ≠ not parseable
 
oh, I get it
nvm
 
ngn
@nathanrogers you seem very confused about trains. read carefully: a train is a sequence of terms that ends with a function. it must be isolated in some way, like being alone on the right-hand side of ← or being enclosed in ( )
3≤+/,∊'aeiou' is not a train because the last term 'aeiou' is not a function
 
8:31 PM
yeah I got that
 
ngn
the 3≤+/ part of it is not a train either, because it's not in isolation, and the sequence of terms continues
 
BQN also has an extensive document on trains.
 
ngn
@nathanrogers so, did you mean something like (3≤+/),∊{'aeiou'} or (3≤+/),∊'aeiou'⍨ or (3≤+/)'aeiou'∊⍨, ?
 
8:44 PM
@ngn ('aeiou'(3≤⊣).(+⌿∊)⍨⊂) 'bunaaaac'
I don't understand how this works
and I wrote it
 
@nathanrogers that happens with trains
 
ngn
@nathanrogers golfed: 3≤1⊥∊∘'aeiou'
 
in particular, I'm confused why 3≤⊣ and not ⊢
 
@nathanrogers it also doesn't work - try 'aeiou' as an input
 
ngn
@nathanrogers i don't think it's correct. what should it return for 'banuuuuc'?
 
8:49 PM
(3≤ 1⊥ ∊∘'aeiou')'bunaaac'
1
how?
it works for me
more than 3 or more vowels 1 less than 3 0
 
@nathanrogers yours doesn't - ('aeiou'(3≤⊣).(+⌿∊)⍨⊂)'aeiou' gives 0
 
uh
wtf
 
@nathanrogers Known bug, being fixed.
 
ngn
@nathanrogers ∊∘'aeiou' is a composition that means {⍵∊'aeiou'}. 1⊥.. is sum. 3≤.. i'm sure you understand that.
 
@Adám what's a known bug?
 
8:51 PM
@nathanrogers click the reply indicator
 
oh thanks
so... ∘ means ⍵ gets applied to whichever side is thefunction?
or you're saying that f∘A is just a curried function awaiting an argument
 
ngn
@nathanrogers a∘f ←→ {af⍵}; f∘a ←→ {⍵fa}; f∘g←→{f g ⍵} (or {⍺ f g ⍵} when applied dyadically)
 
@nathanrogers yep, that's precisely what that is. and A∘f does the obvious thing of currying the left arg
 
cool
didn't know that
I thought it was positional
i'm not sure how this works either
(∨/ 2=/ ⊢)
I would have assumed this would (∨/⍵) 2=/ {⍵}
oh
never mend
 
@nathanrogers with ∨/f and =/g, does (f 2 g ⊢) become clearer?
 
8:58 PM
its ∨/ {2} =/ {⍵}
i'm getting there, its slow, but I wrote a few trains, ok?
 
ngn
22 hours ago, by ngn
if you have more than 3 functions in a row, the last 3 become a fork
 
a fork being f g h i (f (g ⍵) h (i ⍵))
 
ngn
@nathanrogers f 2 g ⊢ ←→ f (2 g ⊢)
 
yes I saw that already
4 mins ago, by nathan rogers
its ∨/ {2} =/ {⍵}
 
@nathanrogers f g h i is an atop and a fork. f g h is a fork
 
9:04 PM
I thought g h i was the fork
with f (g h i) as the atop
 
@nathanrogers right, g h i there is the fork. i was saying that in general
 
oh
hah thanks
now this confuses me
nvm again
s05_1  ← 1⊥{                             ⍝ 5_1 How many total where:
    pair ← ∨/2=/⊢                        ⍝ ... Any neighbors match?
    vowl ← 3≤1⊥∊∘'aeiou'                 ⍝ ... 3 or more vowels?
    subs ← 'ac' 'cd' 'pq' 'xy'∨.(∨/⍷)⊂   ⍝ ... Substrings exist?
    (pair ∧ vowl ∧ subs) ⍵               ⍝ ... All true?
}¨
@ngn problems?
looks like errors
nevermind... again
^
line(36,0) : error AC0008: error (SYNTAX ERROR) executing line "}¨"
ok now I know this has to wrong
I've done this a lot
what's the problem here
is this a v18 thing?
 
@nathanrogers dyalog may or may not Sometimes™ allow multiline dfns only in abc←{…} and nothing else
 
I don't follow
 
9:19 PM
@nathanrogers multiline dfns are special, in that in some contexts you can only assign them and nothing else
 
I am assigning
 
@nathanrogers but you're also using it as the operand of ¨
 
I removed the 1⊥ and I know for a fact I have code that does
f ←{
...
}¨
¨ is a function now?
 
no, an operator
 
whatever
I didn't know it was an operator in the first place
 
9:21 PM
what else would it be
 
syntax?
 
@nathanrogers it's a regular monadic operator like or / or
 
yeah well, I have other operators defined similarly
sorry, operator derived functions
s02_1 ← +/{{(⌊/⍵)+ 2× +/⍵} 2×/ ⍵,⊃⍵}¨
like that one
no errors
 
@nathanrogers that dfn isn't multiline though
 
i mean
 
9:24 PM
if you have a multiline dfn, you must assign it immediately and nothing else because Reasons™
actually, it seems you can use multiline dfns mid-expression inside dfns, but not inside :namespace. Dyalog yay
 
who needs more than 1 line anyway /s
 
I know I have done this
I thought for sure in APL2XL I had a dfn or 10 that was defined with ¨
but I can't find it!
I've truly stepped into another timeline
 
@nathanrogers maybe inside another dfn, like i said
 
no I mean, I know I"ve defined
f←{
...
}¨) can't even do this
@Adám is this intentional?
this has to be a v18 bug, I'm downloading 17.1 to check
 
@nathanrogers as i said, maybe you wrote that inside another dfn. see this
 
9:27 PM
oh I see
bleh
yes everything besides the external mutation and error handling is done inside a dfn
so that's probably right
 
it's absolutely stupid that this is the case, but what can ya do
 
oh yeah fun fact it doesn't work with ]dinput either
 
agitate
 
it's like the parser sees the } and goes 'yep we're done here ok time to go home'
 
s05_1  ← {{                             ⍝ 5_1 How many total where:
    pair ← ∨/2=/⊢                        ⍝ ... Any neighbors match?
    vowl ← 3≤1⊥∊∘'aeiou'                 ⍝ ... 3 or more vowels?
    subs ← 'ac' 'cd' 'pq' 'xy'∨.(∨/⍷)⊂   ⍝ ... Substrings exist?
    (pair ∧ vowl ∧ subs)⍵               ⍝ ... All true?
}¨⍵}
oh yeah, this is dandy
 
9:29 PM
@nathanrogers yay for workarounds
 
also you could just (pair ∧ vowl ∧ subs)¨⍵ instead
 
true
ok here's something strange
     ('ac' 'cd' 'pq' 'xy'⍱.(∨/⍷)⊂)¨ 'acasdf' 'cdasdf' 'pqasdf' 'xyasdf'
0 1 0 0
why is cd ok, but the rest aren't?
 
ngn
@nathanrogers why ⍱ instead of ∨
 
⍱/x is not the same as ~∨/x
 
9:43 PM
@nathanrogers It is a known bug in namespaces, but it works in the new multi-line mode, and thus it works in !# scripts too, so… yay?
 
what new multiline mode (]dinput?)
 
!# scripts are real now?
@ngn because I want a 1 where not includes
 
@nathanrogers ⍤0 1 pairs up scalars from the left with vectors from the right. ⍤0⍤1 pairs up vectors, then inside those, it pairs up scalars.
 
@nathanrogers see my message
 
@rak1507 That's obsolete now.
 
9:44 PM
what's replaced it?
 
@nathanrogers In 18.1, yes.
 
@rak1507 its giving me the same results now
 
⋄ ~('ac' 'cd' 'pq' 'xy'∨.(∨/⍷)⊂)¨ 'acasdf' 'cdasdf' 'pqasdf' 'xyasdf'
 
@rak1507
      ('ac' 'cd' 'pq' 'xy'(~∨).(∨/⍷)⊂)¨'acasdf' 'cdasdf' 'pqasdf' 'xyasdf'
0 1 0 0
 
yes
 
9:45 PM
cd is the only one returning problems
 
(~'ac' 'cd' 'pq' 'xy'∨.(∨/⍷)⊂)¨'acasdf' 'cdasdf' 'pqasdf' 'xyasdf'
 
the others are returning accurate results
 
@rak1507 Proper multi-line input mode:
 
the others are getting the right thing for the wrong reason
@Adám oh cool not a hack
 
@rak1507 Not at all.
 
9:45 PM
great!
 
@nathanrogers (~∨)/a is still not what you want
 
Plus, if you edit things that are indicated by that green [ then the whole block is run again.
 
@Adám so !# scripts are in 18.1?
 
@nathanrogers Yes, yes, they are.
 
9:46 PM
Not !#, it's #!
 
@nathanrogers ⍱/∘.=⍨⍳4
 
Added a large section on the history of APL control structures. Can anyone confirm that GNU APL doesn't have them?
 
@Bubbler Yes, of course :-)
@Marshall Confirmed:
      ∇ foo
      :if 1
      :endif
      ∇
Line 1
Offending token: (tag > TC_MAX_PERM) 0x43030019 :
Statement: `:  `'if  `VALUE3«1»
Fatal error in defined function. Please correct (or else delete with [∆1])
 the offending line indicated above.
 
ngn
this isn't an error message, this is an error novel :)
 
comment on second answer says that the → is correct control structures in gnu apl
 
9:51 PM
@nathanrogers Not sure what you mean. Can you link to the comment?
 
idk how?
6
A: If-Else conditions with APL?

danbIf your APL supports control structures then this should work: ∇ generateAll number :If number>100 ⎕←'Too high' :else ⎕←⍳ number :endif ∇ If it does NOT support control structures (like APL2) you will need to branch: ∇ generateAll number →(number>100)/error ⎕←⍳ number →0 error: ⎕←'T...

 
The second example (without control structures) should be correct for GNU APL. — Lobachevsky Jun 22 '16 at 10:19
 
comment by lobachevsky
 
@Adám Thanks. I guess it's unlikely it would use a different syntax when : is so common.
Would be nice to know where that syntax comes from as well. Looks like APL*PLUS had them (at least :for) before Dyalog, based on this paper.
 
@nathanrogers Oh, that wasn't the second answer in what SE showed me :-)
@nathanrogers fyi, for next time: click the time next to the comment.
 
9:59 PM
oh ok
ty
 
10:24 PM
@Marshall Definitely APL*PLUS; I've added some Vector articles from when it introduced them as references.
From Adrian Smith: "This apart, I can see no problems with the basic idea, so the sooner everyone else copies it, the happier I will be."
 
@Adám I'm getting all kinds of import errors
nonstop
s05_1_tests ← {,⊂{(⊂0⌷⍵),(+/1⌷⍵)}⍉↑⍵} s05_1a_tests
it imports this line just fine at ]link time
but when the file is modified, errors for days
 
@nathanrogers Wait, that looks awfully recursive.
 
1a
 
line(73,0) : error AC0008: error (DOMAIN ERROR) executing line "s05_1_tests ← {,⊂{(⊂0⌷⍵),(+/1⌷⍵)}⍉↑⍵}s05_1a_tests"
^
line(74,0) : error AC0008: error (VALUE ERROR) executing line "s05_1_tests ,←(i05 258)"
^
Complete: 2 errors.
line(73,0) : error AC0008: error (DOMAIN ERROR) executing line "s05_1_tests ← {,⊂{(⊂0⌷⍵),(+/1⌷⍵)}⍉↑⍵}s05_1a_tests"
^
line(74,0) : error AC0008: error (VALUE ERROR) executing line "s05_1_tests ,←(i05 258)"
 
@rak1507 Oh, missed that.
 
10:28 PM
it runs just fine from the session
 
@nathanrogers So you're running code straight in the namespace script?
 
I'm assigning variables in the namespace
in text files
 
@user13730524 Hi alphatask. If you want to participate here, then email access@apl.chat
@nathanrogers Namespace scripts don't stop on error, but try to continue fixing the script. Having skipped an erroring line, you get this sequence of errors. Try to avoid running code at fix time.
 
I'm not trying to run code, but I already have data defined and just want to reshape the values......
 
Don't do that at fix time.
 
10:33 PM
I want the _tests to be assigned some value, that isn't static
... its in a text file
when else can I do it
 
At run time.
 
I have the project linked, and its in a text file
and I'm updating the text file...
 
You really shouldn't use Link to run code whenever a file is changed.
 
I'm not
 
If your namespace script contains s05_1_tests ← {,⊂{(⊂0⌷⍵),(+/1⌷⍵)}⍉↑⍵} s05_1a_tests outside a function, then you are.
 
10:35 PM
a←('a' 1)('b' 2)
is just fine for a
but now c
c ← values in the first column paired with the sum of the 2nd column
I mean, I'm not, IT is
I'm just editing text
 
@nathanrogers Well, obviously it is the interpreter that executes APL, not you, but you are relying on it to do so.
 
I'm relying on it
 
Namespace scripts are for declaring namespace members.
 
to read text files
 
@nathanrogers And do what with them?
 
10:37 PM
whatever it needs to in order to properly read the text thats in the files
ok
lets reframe this
 
May I ask what extension your text files have?
 
.apln
HOW do I define a bunch of variable names known to a namespace such that I can just assign them arbitrary expressions?
 
@nathanrogers That's going to give you trouble because Link will think that .apln files contain namespace declarations. How about using .txt for text?
 
does link read .txt files for the purpose of importing source code to be executed in the session?
 
@nathanrogers I don't understand.
@nathanrogers No, not by default.
 
10:40 PM
right
THATS whiy
 
you want to use APL like any other language where you can put things in files and run them? too bad :D
 
what's not to understand. I have variables that depend on other data, and I need those variables to have those values
and those varaibles are scoped to a namespace
@Adám so HOW do I do that?
in such a way that it doesn't crash every time I make a text change
 
@rak1507 Yup, if that's what he wants, then tough luck. Wait for 18.1.
@nathanrogers You want to make changes to basic data, and have APL re-compute final data on the fly?
 
i don't care when it does it that is of no importance to me, I don't care what is happening under the hood, I care that myNS.var has the value I expect
WITHOUT CRASHING
so HOW do I do that?
 
you don't
 
10:43 PM
no
 
@nathanrogers Simple: Write the correct code!
 
yes
so what is that code
obv
that is literally the question I"m asking
 
The one that will cause the effect you want.
Obv.
 
@Adám have you considered helping
 
10:44 PM
@rak1507 Yes, I've considered it.
 
because that code is crashing on import
 
Then it isn't the correct code. Obv.
 
@nathanrogers what is your code
 
:Namespace myNS
data←('a' 1) ('b' 2) ⍝ ... etc
var←{column 1 , sum col 2} ↑data
:EndNamespace
 
@nathanrogers So when you fix the namespace. the 3rd line is processing the data from the second line.
That's more than just declaration.
That's running code.
Don't do that at fix time.
 
10:46 PM
again
how do I write it
 
Namespaces are for declaring members.
 
such that I'm not doing something that causes a crash
 
Not running code.
 
I need var to have that data
 
May I venture to say that you need the name var to return that data?
 
10:47 PM
that's what I would expect from the above
because its valid APL
 
Try:
:Namespace myNS
data←('a' 1) ('b' 2) ⍝ ... etc
∇var←var
 var←{column 1 , sum col 2} ↑data
∇
:EndNamespace
@nathanrogers Clearly it isn't.
 
clearly it is, but its a problem with loading the files as namespaces
 
@Adám what i expected. That'll re-evaluate that on every instance of var which is usually stupid
 
ngn
@nathanrogers are you using linux?
 
windows
 
10:48 PM
@dzaima But that's fairly easy to fix.
 
@nathanrogers you're loading code, not a namespace
 
@dzaima ^ 1000×this ^
 
ngn
@nathanrogers sadly, no #! there
 
you keep telling me what I'm doing
I'm not doing it
I didn't design the thing that's doing the thing
 
@Adám hacky solutions to fix hacky solutions to fix...
 
10:49 PM
IT is doing it
I'm not against a workaround
but this isn't it
 
@nathanrogers You asked for it with :Namespace
@nathanrogers Did you try my code?
 
I mean, that's because I need to namespace the data
it isn't a matter of it working or not
can I define a DFN like so:
 
@nathanrogers you intentionally wrote code that executes stuff. Namespace files are for declaring stuff, not executing it
 
@dzaima 1000×this ^
 
load←{
myNS.var←{evaluation}↑data
}
 
10:50 PM
@nathanrogers Yes, and that won't execute at fix time. So that's fine.
 
ok
do I need ∘←
 
No. Never.
 
fine
@dzaima obviously I wrote code that executes
that's what you do with programming
 
@nathanrogers but that's not what a namespace file is for
 
there shouldn't be a fundamental difference between a ← {⍵} and a ← somevalue
 
ngn
10:51 PM
@dzaima why does it allow initializers then?
 
you may not like that, I may not like that, but that's the way it is
 
@Adám in that load dfn is ⎕THIS still known?
 
@ngn no clue
 
@nathanrogers Yes, ⎕THIS is always known.
 
let me rephrase
if load is defined inside myNS will ⎕THIS reference myNS
 
10:53 PM
@nathanrogers Yes, what's the definition of ⎕THIS.
 
in other languages, this changes context inside of bodies
so I was clarifying
 
@nathanrogers bodies?
 
function body, class body, blocks of code
 
Ah, but ⎕THIS just refers to the current namespace, nothing else.
It can never refer to a function.
 
that's good
 
ngn
10:55 PM
@Adám it should've been called ⎕somethingelse
 
I was planning to optionally load tests anyway, so this just means I don't have to do that later
 
@ngn Agreed.
 
Naming is apparently hard.
@nathanrogers We are waiting.
 
so you're saying that its fine so long as I don't modify the expression?
i can link it, but don't change the values
 
10:56 PM
No, I'm not saying that.
 
well
then your axiom doesn't hold
 
What axiom?
 
because elsewhere I'm assigning variables to the results of reading a file
the axiom that I shouldn't evaluate code inside namespace
 
@nathanrogers I have no clue what that sentence means.
@nathanrogers What‽ Oh.
 
i01 ← ⊃ 2015 #.day 1
this reads text from a file
 
ngn
10:57 PM
@nathanrogers in soviet russia variables assign to values :)
 
@Adám presumably :namespace \n abc←⎕nget'something' \n :endnamespace
 
@dzaima That looks like a truly terrible idea.
 
@Adám but why not do it? it's initializing constant data, just not as constant as you may like it to be
 
@dzaima Code like that would fail to load if its companion file is missing.
 
but the companion file is part of the project
 

« first day (1501 days earlier)      last day (1154 days later) »