« first day (1785 days earlier)      last day (1166 days later) » 
00:00 - 17:0017:00 - 22:00

17:00
⎕←5⌽⌽'Hello'
@Fmbalbuena olleH
⎕←1⌽⌽'Hello'
@Fmbalbuena lleHo
⎕←4⌽⌽'Hello'
@Fmbalbuena Holle
17:03
@Adám why 4⌽⌽'Hello' returns 'Holle'?
Dyadic is rotate.
@Adám yeah i know
@Adám it's always active
maybe ctrl-shift-r would help
@Adám Why 6÷2(1+2) returns 3 2 instead of 3 3?
why do you expect 3 3 there
17:06
How do you get the value of an environment variable like 'MAXWS' for example?
⎕←6÷2(1+2)
@Fmbalbuena 3 2
6÷2(1+2) is 6÷2 3 is 3 2
@Fmbalbuena 2() doesn't multiply.
ok, now tell me why you expect 3 3
17:07
@11Kilobytes Did you try APLcart?
@Razetime 6 ÷ 2 (1 + 2) => 3 (3) => 3 3
@Fmbalbuena Every APL function takes as right argument, everything to its right.
@Adám Nope, thanks @Adám.
@Fmbalbuena stranding always happens first
that's 6 ÷ (2 (1+2))
17:09
^
6 ÷ 2 (1 + 2) => 6 ÷ 2 (3) => 6 ÷ 2 3 => 3 2
opposite of ?
@Fmbalbuena Kind of
But can return results that cannot handle.
⋄(⍎'34')+32
17:12
@Fmbalbuena 66
@Razetime Yeah. I should blame. Btw, it doesn't change background colour when pressing `
@Fmbalbuena Do you want a simple task?
@Adám yep
Write a monadic function that given a string, determines if it is (1) a palindrome or not (0)
whoops
pressed enter.
@Adám F←{(⌽⍎⍵)≡(⍎⍵)} (Untested)
⋄{(⌽⍎⍵)≡(⍎⍵)}434
@Fmbalbuena
DOMAIN ERROR: Illegal token
      {(⌽⍎⍵)≡(⍎⍵)}434
      ∧
17:19
⋄F←{(⌽⍎⍵)≡(⍎⍵)}⋄F 434
@Fmbalbuena
DOMAIN ERROR: Illegal token
      F←{(⌽⍎⍵)≡(⍎⍵)} ⋄ F 434
                       ∧
@Fmbalbuena I'm not sure what you're doing, but you should be able to take 'racecar' and return 1 and take 'hello' and return 0.
@Adám F = Lambda ((Reverse Str Arg) Equals (Str Arg))
@Fmbalbuena Can you try that in APL?
And even in whatever language that is, what does Str do?
@Adám This is pseudocode that i try to do
@Adám convert int to str
17:27
Where do ints come into the picture?
> Write a monadic function that given a string, determines if it is (1) a palindrome or not (0)
⋄F←{(⌽⍵)≡⍵}⋄F '434'
@Fmbalbuena 1
⋄F←{(⌽⍵)≡⍵}⋄F '43434' '4627678371897381728371873789327189' '13107270131'
17:30
@Fmbalbuena 0
@Fmbalbuena Good.
Now, can you think of how to move things around so you don't need the inner parenthesis?
⋄F←{⌽⍵≡⍵}⋄F '434'
@Fmbalbuena 1
⋄F←{⌽⍵≡⍵}⋄F '4344'
@Fmbalbuena 1
17:31
nope
Do you need a hint?
@Adám, you may want to know that the method as written on APLcart doesn't output anything because you have to put something to catch the result, so e.g. (+2⎕NQ#'GetEnvironment',⊂)'DYALOG' and (⊢2⎕NQ#'GetEnvironment',⊂)'DYALOG return something but just (2⎕NQ#'GetEnvironment',⊂)'DYALOG' doesn't.
@Adám why? its solved.
@11Kilobytes Oh, I just removed recently, not thinking it through. Thanks. Btw, it still works without but you can't see that it does. If you capture or use the result, it'll work just fine. (Pushed fix now.)
@Fmbalbuena Yes, but it is good training for you to figure out how to remove the parenthesis.
@Adám one more command?
17:35
Only if you figure out how to remove that parenthesis.
I can give you up to two hints if you ask for them.
@Adám a hint
Every APL function takes as right argument, everything to its right.
@Adám yeah i know.
@Fmbalbuena Good. It is an important rule. Do you need the other hint?
@Adám yeah
17:42
Equality is commutative. (You know what that means?)
@Adám yes
OK, then those two hints together should allow you to rewrite {(⌽⍵)≡⍵} without the parenthesis around ⌽⍵.
is there a problem?
With what?
{⍵≡⌽⍵}
17:44
Bravo!
Now you want one more function?
@Adám of what?
APL.
I mean, do you want to learn one more function?
@Adám does same as {⍵≡⌽⍵}?
No, something new.
bulitin function?
17:49
Yes. We call those "primitive functions".
@Adám yep
Did I ever teach you about dyadic ?
@Adám no
OK, then I'll teach you 2 for the price of 1, again.
a↑b is similar to a⍴b in that it takes the first a elements from b: ⋄ 2↑'Hello'
@Adám He
17:51
However, if you take too much, it pads with appropriate elements: ⋄ (10↑'Hello'),'X'
@Adám Hello X
And for numbers: ⋄ 10↑⍳4
@Adám 1 2 3 4 0 0 0 0 0 0
⋄ 6↑'Hello'
@Fmbalbuena Hello
17:53
Also, if a is negative, it takes from the rear: ⋄ ¯10↑'Hello'
@Adám
     Hello
⎕←¯4↑'Hello'
@Fmbalbuena ello
So dyadic is called "take" because it takes elements from the right argument. Can you guess the symbol for "drop" which drops elements from the right argument?
@Adám yep
17:57
And it is…?
⋄3↓'⋄3↓'''
@Fmbalbuena '
Very good.
@Adám which i should put the commands that i learned?
@Adám A medium difficulty task which needs or .
@Fmbalbuena Given a positive number n as left argument and a string s as right argument, check if the first n characters of s are identical to the last n characters of s.
18:07
Is it possible to do elifs with guards?
@FawnLocke It is trivial; just put another guard in the next statement.
Thanks :)
However, I'm lobbying for a way to do andifs.
f←{(⍺↑⍵)=(¯⍺)↓⍵} syntaxerror
@Fmbalbuena Because ¯ is not a function; it is part of a number literal. is not a number literal.
18:09
- will negate?
yes
LENGTH ERROR: Mismatched left and right argument shapes
f←{(⍺↑⍵)=(-⍺)↓⍵}
Well, yes, think about it: If has 5 elements and is 2, then ⍺↑⍵ has 2 elements and (-⍺)↓⍵ has 3 elements.
@Adám Funny, this is exactly what I needed, not an elif :)
Right. The proposed syntax is {cond1:cond2:result if both are try ⋄ result otherwise}
18:13
@Adám f←{(⍺↑⍵)≡(-⍺)↑⍵}
@Fmbalbuena Perfect.
@Adám Is there ternary if/else statements for some reason.
Well, dfns have {condition:result if true⋄result if false} and tradfns have
:If cond
  code if true
:Else
  code if false
:EndIf
But there are no real inline ternaries because that would tie together two characters into a single thing.
That said, you can write result if true (⊣⍣condition) result if false
VALUE ERROR: Undefined name: false
@Fmbalbuena ?
18:17
      f←{⍵=5:5 if true⋄432 if false}
      f 4
VALUE ERROR: Undefined name: false
      f 4
                     ∧
@Adám ^
No no, there are no reserved words in APL, result if true was just a placeholder for the result to be returned if the condition was true.
VALUE ERROR: Undefined name: if
f←{⍵=5:5 if 1⋄432 if 0}
@Fmbalbuena There are no reserved words in APL. Everything after : is the expression returned if the expression before : gives 1.
⋄ f←{⍵=5:5 ⋄ 432} ⋄ f 5 ⋄ f 10
@Adám
5
432
much better
18:23
Do you want another task using and ?
@Adám yes but not now.
OK, ping me when you want it.
:D. My first time improving the efficiency of a solution.

cmpx 'F1¨t' 'F2¨t'
F1¨t → 4.5E¯1 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
F2¨t → 1.9E0 | +317% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕`

(F1 is the improvement).... still very slow :)
It is a bit easier to understand if you put the reference solution first.
18:29
Also, for next time, put your code in a separate message and press Ctrl+k.
Mhm, keep forgetting there's no backtick codeblocks
I kind of wish cmpx had the option of sorting by decreasing time.
That'd be nice, yeah
@PyGamer0 Now so.
RGS
RGS
@xpqz was carefully checking the licence on your book to make sure I could reuse the CSS you had there only to realise you started with the (little) CSS MDAPL has and that you modified 🤣
18:39
@Adám ping
Can I use try APL ?
@Wolgwang Of course.
use= abuse :--(
in Winter Bash 2021, 6 mins ago, by Catija
Nail down that number
@Wolgwang Well, consider using the sandbox or tryapl.org not to unnecessarily flood this room with noise.
@Wolgwang OK, the sandbox room then.
Ohk Thanks :-)
18:41
Has anyone successfully installed .NET core and used it with Dyalog on macOS?
@11Kilobytes Yes, @xpqz
@Fmbalbuena Given a number n as left argument and a string as right argument, insert the letter 'X' after the nth character of the string. E.g. 3 and 'Hello' should give 'HelXlo'
@Fmbalbuena What?
@Adám Too Hard;Still making a dfns.
This is an easy problem if you remember how to join strings.
@Adám Using ",".
Yes, so you just need one small dfn to solve this problem.
I can give more hints if needed.
18:46
a hint
Think about what are the three parts of the result that need to be joined.
third part?
You get 'Hello' and 'X' and you need to make 'HelXlo'. What are the three logical parts of 'HelXlo'?
f←{(⍺↑⍵),'x',⍺↓⍵}
or
f←{(⍺↑⍵),'X',⍺↓⍵}
Perfect!
See? Not so hard after all.
18:52
@Adám Didn't John Scholes propose syntax for this?
Yes:
40 mins ago, by Adám
Right. The proposed syntax is {cond1:cond2:result if both are try ⋄ result otherwise}
RGS
RGS
@RGS looking more carefully, I think your custom CSS hasn't been deployed, @xpqz. Inspecting the page shows that the DejaVu font is not being used, and opening the style inspector shows that your file custom.css doesn't have the new rules.
⎕←'Hello, World!!!!!11111!!!!!'
@Fmbalbuena Hello, World!!!!!11111!!!!!
@Adám is Dyalog employee?
18:55
@Fmbalbuena Please don't just post noise. Go to the sandbox room for that.
@Fmbalbuena Yes. (If you mean to ask if I am.)
RGS
RGS
Finally, and sorry for the third ping in a row @xpqz, I don't understand why you have a rule targeting .CodeMirror pre, given that I can't find anything with that class in the book source.
Ok, @xpqz ⊢2⎕NQ '.' 'GetEnvironment' 'DOTNET_ROOT' evaluates to '/usr/local/share/dotnet' which names a folder that contains the dotnet executable. Moreover, ⊢2⎕NQ '.' 'GetEnvironment' 'DYALOG_NETCORE' evaluates to the /string/ 1. I tried to do stuff with .NET but failed (e.g. the standard DateTime examples don't work), and I suspect it's because 'DYALOG_NETCORE' is set to a string instead of a boolean/integer. Did you have to set it to 1 (the integer) and if so, how did you do it?
@Adám why?
Are you asking why I am a Dyalog employee?
@Adám yes
18:58
Well, because Dyalog hired me ;-) and because it means I can do APL all day while earning enough to sustain my family, and because it is a nice place to work.
2
@Fmbalbuena Btw, you can see who works at Dyalog here. Why did you ask if I'm a Dyalog employee?
19:22
Alternatively @xpqz, if you have a guide about how to set up .NET core + Dyalog APL on macOS somewhere I would love to read it.
@11Kilobytes DYALOG_NETCORE can be an environment variable or command line parameter, so a string is the only option, and as it should be.
19:42
@Adám got it thank you.
 
2 hours later…
21:24
@11Kilobytes I’ll have a look tomorrow, but as I recall the key issues are that you must use a specific, older version of .net , and 18.1/2 beta of Dyalog.
@xpqz Oh, it didn't work with 18.0?
And yes, specifically .NET Core 3.1
I never got it to work on 18.0, but can’t say that was the official line, or just me.
It may well be that it couldn't work. If so, then patience for 18.2 is the way.
With compatible versions it just works. I didn’t need to do anything in Dyalog for it to pick it up.
That was my impression of how it worked.
00:00 - 17:0017:00 - 22:00

« first day (1785 days earlier)      last day (1166 days later) »