Also, in a nested function, are there better ways of referring to the arguments to the above function than just assigning them to another variable (like (x:a))?
@BrowncatPrograms That's a big reason why you want to use lambda expressions whenever possible. You can do _+a where you wouldn't be able to do {a+[above function's a]}
In an earlier stage of the language design process, I was planning to make \a be the next outer scope's binding of a, with possibly unlimited numbers of backslashes for unlimited numbers of scopes... but then I realized it wouldn't ever get used, so what's the point
Referencing the top-level arguments inside a function is sometimes necessary in practice, though, which is why I figured making global variables to store those was a good compromise.
@DLosc hey same. Vyxal v1 had the ability to move up and down function contexts, but I saw that no one used it, so I just removed the context changing stuff
It's not necessary to have properly nested scopes, though they can be handy at times (especially if you need to construct functions in order to pass them into some higher-order built-in)
One way is to have an implicit "argument stack" and reference args at higher scope by index
Okay, I have a problem. I have (ka@>(x:_))M, where there's stuff after M that's mapped over, and k is a function (and a is from the outer scope). I think a@>(x:_) is being parsed as a lamda which is passed to k, when I want the whole thing to be a lambda (k and all). Am I going to have to use a normal function instead of a lambda?
@cairdcoinheringaahing i'm kind of disappointed that the worst captchas of all time link in one of the lower answers is to some kind of long defunct file sharing website that managed to serve the actual content in a way that's opaque to wayback machine
Well you can have the map pass one argument in, and each recursive call pass a second argument, and you can distinguish between the two cases by checking if #g is 1 or 2...
If you have an x^y glyph, 2^x should be at most as long as x^y to have a meaningful golf using it (or could be one byte longer depending on the syntax or paradigm, e.g. if it's stack based then doing 2^x using x^y would involve a swap)
The two things that immediately jump out to me are 1) you can remove all the semicolons and 2) you can replace == with Q (string comparison) in this case, I think.
Oh, better idea: that function checks if a list of strings is a palindrome, right? That can just be {aQRVa}, which can then be a lambda expression _QRV_
@BrowncatPrograms Try {z@<aAL_M(kz@>a)} for your nested function. I'm not 100% sure it'll work, but I don't think I see a reason for all the assigning back and forth there.
@pVCaecidiosporeadduced I can't watch the full video series right now, but having an infinitely increasing slider doesn't give you TCness unless you can stop it using an internal global state (not user input)
i don't think votes should solely determine whether a post should be around / be nuked anyway, meta or not. and i don't see much else about the post that's negative
@Bubbler i've been here most of the past few hours i was just playing league so i only checked just now and saw something about jelly and rickrolls lmao
Btw Given a set of integers, find the sum of all integers in it. on line 95 is part of code, I recognize the challenge too
I'm really seeing all sorts of weird code fragments from various code-challenges and restricted-source and stuff. They should be removed in order to get some meaningful results I guess
> In this answer, I coded it so that the program errors when executed․\nAlso, according to code-golf statistics, only a small percentage of people who view my answers actually upvote․ \nSo if you enjoy this answer, please consider upvoting - it's free, and you can change your mind at any time․ \nEnjoy the answer․
Could be interesting. Cause, it'd have to actually make sure it was at the end, so it could only add it once the enter key is pressed, and assuming the message doesn't end with :P