« first day (2 days earlier)      last day (49 days later) » 

Leo
12:08 AM
The `ᵗ` infix operator according to the documentation should return the last R elements from L, but it seems to be returning the elements from L starting from index R instead; knowing this you can set R to 1 to get all the elements except the first from L.
Prepending or appending things can be done with `‖` https://tio.run/##K8/ILC5ILSo2@v/fTiHaUMdIx1jHJJbLTsGQyw5IPNw63QjIMQVxjB81TDMBMfxLSwpKSxRM//8HAA
 
@Leo Oh nice, thanks!
 
Leo
12:23 AM
And I made a sad discovery for the Buffalo challenge... Printing the complete string directly is shorter than any other approach I could find :( codegolf.stackexchange.com/a/218498/62393
But I have a general question about Whispers submissions: couldn't we avoid counting the final Output line most of the time? We can consider the rest of the program a function returning the desired output, printing it to the screen with a full program is not generally required for submissions
 
 
1 hour later…
1:44 AM
@Leo lmao
 
 
2 hours later…
3:35 AM
@cairdcoinheringaahing why does
> ℕ
>> Output 1
just output set notation instead of the infinite list
 
 
3 hours later…
6:21 AM
@Leo I know just how painful it was
I tried doing so myself
But I missed the Then
 
6:41 AM
@Leo Yeah, string and array handling is one of the things in Whispers which I’m torn about redoing to be nice. On the one hand, it’s designed to be primarily mathematical, on the other, strings are a very common thing
@Razetime So that it doesn’t crash the interpreter trying to print things. The object is still treated as an infinite list
@Leo I’m not sure if it’s in the latest version on GitHub or if it’s just on my local device, but the last time this came up I added a Rewrite function that allows for dynamic rewriting of the source code, in an effort to make it TC. If you’ve got any other ideas to make it TC, I’m more than happy to hear them
Just a reminder as well, if you edit your Whispers answers into the LotM post (codegolf.meta.stackexchange.com/q/20698/66833), your first answer is eligible for a bounty
 
7:16 AM
@cairdcoinheringaahing so how to I print part/ a certain index of it?
 
7:27 AM
@Razetime Pretty sure you can use the ⁿᶠᵗ commands on it
 
ok gr8
now to find a sequence problem
 
 
4 hours later…
11:01 AM
@cairdcoinheringaahing how to use use the result of ×?
it gives an itertools product
 
11:25 AM
@cairdcoinheringaahing how does set intersection work?
@cairdcoinheringaahing this is what I'm trying:
> Input
> Input
>> 1…2
>> {3}
>> ℙ
>> 5∩4
>> Output 6
 
12:02 PM
@cairdcoinheringaahing how do I reduce across a list
/fold
 
12:19 PM
There isn’t a Fold builtin, so you’ll have to implement it yourself
@Razetime Use v3 for the Cartesian product, it’s very broken in v2
@Razetime The 5th line should start with just one >, and the InfSets don’t work with regular sets. I’d suggest using Select and the is prime builtin
 
12:53 PM
@cairdcoinheringaahing I figured out the select based method
@cairdcoinheringaahing nooooo
@cairdcoinheringaahing I am using v3
question it
what do I do with the object
 
 
1 hour later…
2:04 PM
@cairdcoinheringaahing Can one map over an array? I tried Each, but apparently that iterates over it?
 
 
1 hour later…
3:16 PM
@cairdcoinheringaahing What are the infsets for, then?
@cairdcoinheringaahing why am I getting None here? Try it online!
 
3:44 PM
@Razetime in which case, no idea. I’ll need to look at the source code when I can
@Razetime Wrong slash
@user Looks like it iterates to me. What were you trying?
 
4:01 PM
@cairdcoinheringaahing you must be kidding me
 
@cairdcoinheringaahing Trying to multiply two arrays together
The factorial sequence with an input
 
4:33 PM
@cairdcoinheringaahing Actually, never mind, I was being dumb
There just isn't an extra 1 at the start of the factorial sequence
 
 
1 hour later…
5:35 PM
I'm trying to sum each list of the powerset
what is going on aaaa
 
 
3 hours later…
8:18 PM
@Razetime You can’t sum an empty list, remove the first element using
 
 
3 hours later…
Leo
10:57 PM
@cairdcoinheringaahing Source code rewriting is always fun, but I don't think it would fit that much with the rest of the language... A simpler idea could be letting the values of L and R always propagate through calls: in the interpreter code this would mean passing left=left and right=right every time you call execute (unless you are already passing other values for those attributes)
This would allow you to write recursive functions, but also give you a way to compose other functions and write stuff like if(a>b) then (a-b) else (a+b)
 
Leo
11:12 PM
As an example, here's how you could compute the factorial of a number recursively tio.run/##K8/ILC5ILSo2@v/…
I only used L and not R here because only allows passing one argument, it would be possible to get around it by using Each instead and wrapping both arguments in a list, but having a way to call a line passing both L and R directly would be helpful
 

« first day (2 days earlier)      last day (49 days later) »