« first day (1722 days earlier)      last day (647 days later) » 

1:23 AM
@cairdcoinheringaahing Can i learn jelly?
 
 
19 hours later…
8:05 PM
@cairdcoinheringaahing I have trouble learning jelly
 
@Fmbalbuena What are you struggling with?
 
Is there an ambivalent function?
 
What's an ambivalent function?
 
Ambivalent is a function that executes a dyadic function of there is left argument, else monadic function.
 
Is that based on APL?
 
8:12 PM
Yes
 
So, the way Jelly parses its programs are different to the way APL parses them. The way the links are parsed depends on whether 1 or 2 arguments are provided
Each command has a fixed arity, so d is always dyadic, H is always monadic etc.
So the concept of a function switching between dyadic and monadic doesn't exist in Jelly
 
@cairdcoinheringaahing +5 doesn't error?
 
2 days ago, by caird coinheringaahing
@Fmbalbuena +5 just means "add 5 to the argument"
 
And what ++5 will do?
 
Depends. If given one argument x, it'll do (x+x)+5 = 2x+5 and if given 2 arguments x, y, it does x+y+5
 
 
1 hour later…
9:25 PM
@cairdcoinheringaahing what ++5 without arguments will do?
 
Have you tried running it in TIO?
 
@user yeah, but i don't understand why outputs 5
 
Oh, you want to know why
 
yes
 
it is a niladic chain, and since it does not start with a nilad, it is evaluated as a monadic chain on 0
the first + is evaluated as dyad on its own and does (val) + (larg) which is 0 + 0 = 0
then, the second + is paired with the nilad 5 which does (val) + 5 which is 0 + 5 = 5
 
9:30 PM
what about “he“+“llo“?
 
That outputs he+llo
 
Why?
 
Strings are terminated by
 
because your quotes are facing the wrong way
so it's actually ["he", "+", "llo", ""]
but jelly smash-prints that into one string when outputting
 
They start with and end with
 
9:31 PM
hlelo?
why?
 
because + is addition not concatenation
and addition vectorizes
so ["h", "e"] + ["l", "l", "o"] vectorizes as ["h" + "l", "e" + "l", "o"]
 
i mean what happens if you use + for strings?
 
so it's ["hl", "el", "o"] which is printed as "hlelo"
 
Concatenation, but also undefined behaviour
 
@Fmbalbuena it vectorizes and adds the characters together
in jelly, strings are meant to be lists of single characters
notice that if you do “he”+“llo” and then put L after it (length), you get 3, not 5
 
9:33 PM
@hyper-neutrino That'd be expected. If you do L€ tho, you'd expect [2,2,1], but you'll get [1,1,1]
 
... what
 
Strings are weird when you make them Python strings
 
Is there a function that does R but [0, 1 ... z]
 
@Fmbalbuena Ż if z is a number
if z is a list and you want it to vectorise, it gets more complicated
 
Differences between ØY and ØC?
 
9:39 PM
ØC has Y and y, ØY doesn't
 
@cairdcoinheringaahing A jelly challenge?
 
? what do you mean?
 
@cairdcoinheringaahing a challenge?
 
As in, do you want me to post a challenge?
I'd suggest trying these or these
 
@cairdcoinheringaahing Lynn challenges? I only can do the first task.
 
9:44 PM
@Fmbalbuena Take a look at #2 of Lynn's challenges. What does each element of the output look like?
 
@cairdcoinheringaahing I still can't do.
 
@Fmbalbuena In which case, try to get the output without limiting yourself to 3 bytes. Then, try and golf it
 
@cairdcoinheringaahing 3RR’ and idk how to golf
 
@Fmbalbuena Take a look at the range builtins, and see if you can shorten R’
 
3RḶ
 
9:48 PM
Very nice :)
I would recommend trying each of Lynn's challenges, ignoring the 3 byte limit, then golfing them down afterwards
 
3R_ I have no idea why reutrns [-2, -1, 0]
 
So, in that case, 3 is chopped of the start, as its a "leading nilad", and R_ is run with 3 on both the left and the right
R generates [1, 2, 3], then _ subtracts the right argument (3) from each
 
@cairdcoinheringaahing Is there a way to fix?
 
9:54 PM
¢ is a nilad, you want Ç
 
can you put code to subtract 1
 
_1 will subtract 1, but you can use
 
sorry, i forgot to change _ to ’
Task 20: Try it online!
 
Nice. I think there's a lot of different ways to get 20
> Order, multiplicity, valuation; how many times is x divisible by y?
For 0, that's inf
 
 
2 hours later…
11:51 PM
@cairdcoinheringaahing or more to the point, it's unexpected if you expect + to concatenate jelly strings, and expected if you expect it to vectorize over jelly lists and act on their non-list elements--in this case python strings
and then ofc that is still fucky with the length example because length will give 1 for anything that isn't a jelly list, even a non-singleton python string
 
@UnrelatedString maybe
 

« first day (1722 days earlier)      last day (647 days later) »