« first day (1646 days earlier)      last day (1008 days later) » 

2:32 AM
Is there a way to run CBQN scripts, like #!/usr/bin/BQN on the first line and ⊑+`∘⌽⍟12↕2 on the second? I tried this but it didn't print anything when I ran it.
 
3:10 AM
I'll ask on matrix maybe
 
3:46 AM
@jordancurve If you didn't get any error messages like "/usr/bin/BQN not found", I guess it ran fine but didn't print anything. You could try calling •Show on the result
 
ah a system function
maybe try Out as well then
 
 
4 hours later…
7:47 AM
@Marshall Did you get an email from Karen? If so, will you reply?
 
 
3 hours later…
11:00 AM
@Adám I replied yesterday.
 
@Marshall Yes, sorry. I wrote this before I was told.
 
@jordancurve I use #! /usr/bin/env bqn, which allows bqn to be located anywhere in the user's path like ~/bin/bqn or /usr/local/bin/bqn. And yes, there's no implicit output so you need •Show to look at results.
 
 
3 hours later…
2:05 PM
Announcment: BAA webinar in an hour. Zoom 858 532 665, passcode: ×/1920 12 17
 
2:32 PM
why doesnt tryapl.org have a prompt like >
or just a rightwards arrow
it would be nicer than indentation
 
@PyGamer0 those both are valid APL characters and as such may be confusing
 
@dzaima what about a totally different character
 
also means it's harder to copy out code of the REPL
 
or ⟩
 
there's probably historical reasons too
 
2:35 PM
@dzaima oh It can be a togglable feature
 
@rak1507 TryAPL just follows Dyalog, and Dyalog does what was done like 50 years ago
 
like ]Prompt ›
 
TryAPL also uses a regular textarea for the code box, and as such it couldn't make you unable to delete the prompt
 
APL's REPL is literally called "the 6-space prompt".
 
2:38 PM
it's a decent idea making it configurable
 
@dzaima i dont think thats a problem
@PyGamer0 and ]Prompt to make it back to the default
 
@PyGamer0 well it definitely is for me (also the home key becomes unusable)
 
g ← {⍺:'t'⋄'f'}
how does ^ work?
 
x:y is if x return y, ⋄ is a statement separator (think semicolon/newline)
 
the ⍺
it only works if i call it like 1 g 0
 
2:45 PM
⍺ is the left argument, ⍵ is the right argument
 
ok if i put a ⍵ in the function; ⍺ will be 1 and ⍵ will be 0?
 
yep
 
 
2 hours later…
4:32 PM
hey, when using ]create # path/to/some/code, is there a way to make sure one file is loaded before another?
Specifically, I have two namespaces where the first uses the other by #.otherNs.function
 
@pmikkelsen Have a look at :Require, however, your namespace really shouldn't "use" another. Only functions in the namespace should refer to other namespaces, and then loading order doesn't matter.
 
@Adám Okay thanks, I will try to reorganize instead
 
@pmikkelsen If you want me to have a look at (that part of) the code, I'll be happy to.
 
@Adám Thanks! Its part of doing advent of code, so I created a namespace for each day, and one for handling input. The code is very simple, so you can look at input.apln and day1.apln for example git.sr.ht/~pmikkelsen/apl-aoc2020/tree
 
4:49 PM
@pmikkelsen OK, so the easiest fix is simply wrapping the content of the namespace in e.g. ∇run and then, after importing the code, you run day1.run
 
okay so this way the load order doesn't matter, right?
 
Exactly.
 
Great, thanks :)
 
Are you interested in additional feedback on your code?
 
If you have any it would be great, but I don't want to waste your time if you have better things to do
 
4:51 PM
As far as I can tell, prods[1↑⍸sums=2020] finds the element of prods corresponding to the first location of 2020 in sums.
You can write that as prods[sums⍳2020]
 
Let me try it
 
fn uses the global variable data. Consider supplying it as an argument. E.g. I'd make the current into and use for the data. This means that the final calls to fn would be 2 fn data and 3 fn data
 
yes good idea :). When I do: sums⍸2020 I get a rank error
 
Wrong iota
 
@pmikkelsen Notice that I didn't have an underbar under – cf.
result1← causes a new variable to be created in the namespace. A more functional approach would be to return the results. Now that you wrap in ∇run you can make run return those two results, simply by amending to ∇(result1 result2)←run
 
4:56 PM
even with normal iota it gives me rank error. Is this because my sums is a matrix?
 
Ah, yes indeed it is.
 
@Adám Great
 
Then what you are doing with and = is fine, but you might want to use 1⌷ rather than 1↑ so you don't end up with a vector.
 
or just ⊃ right
 
@rak1507 No, because we want an enclosed vector, as return a vector of vectors.
 
4:58 PM
ah
 
Okay nice :)
 
@pmikkelsen Finally, you might want to adopt a naming convention to distinguish between functions like fn and variables like sum. For inspiration, have a look at abrudz.github.io/style/#nc
 
@Adám Good idea, coming from another language it is always hard in the beginning to get used to conventions :) Thank you for all the feedback
 
Well, these are my personal preferences, not community conventions.
 

« first day (1646 days earlier)      last day (1008 days later) »