@Bubbler Yeah, I guess that's more the main reason for rec. Languages that don't have the restriction of needing to use a variable/module/whatever below its definition probably don't need rec+and
Make a Custom Bayer Matrix
code-golf matrix array
A Bayer matrix is a threshold map used for ordered dithering that gives the illusion of having more shades of color than actually present by using a crosshatch-like pattern.
Bayer matrices are square with a side length that is a power of 2. Here a...
@Seggan TBH my gut says no. Unless you're reading ahead to ensure a is assigned before b is /ever/ called, one should ensure a is explicitly initialised "Just in case".
And if it turns out it's absolutely necessary, you can make the programmer explicitly say "this variable may seem uninitialized but I guarantee you it is not. If it turns out to break, that's on me. I won't file a bug report yelling at you"
The city defines a dog as any living entity with four legs and a tail. So raccoons, bears, mountain lions, mice, these are all just different sizes of dog.
Given an ASCII-art image of an animal, determine if that animal is a dog.
Rules
An animal is a dog if it has four legs and a tail.
The foot o...
Sure sometimes if a variable fails to be initialized, having it at a sensible default value that you're mandated to choose is fine and everything's good. But quite often there is no sensible default; you just don't know the value yet, and if it never gets assigned, using some sort of default would just mean your program's both broken, and perfectly fine from the compiler/interpreter/program's POV
You don't need to set it to a garbage default, just ensure the function cannot be defined before the value is assigned. I feel it'd be slightly nicer if it could instead just be caught at runtime instead of compile time.
(Or some other method to ensure it's setup before it's called)
I think that makes sense, except that I could see it being reasonable to (well actually I can't since immutability ftw and functions should be pure, but playing devil's advocate) use a function to initialize global/higher scope variables
E.g., you might have a function updateName that takes the user's name and updates a record containing it. Perhaps you run that right at the start, but can also run it later. The name global starts off uninitialized but would be set before ever being accessed
Tho that's definitely an XY scenario since it should really be done with a getUpdatedName function, that leaves it to the caller to decide what to do with the new name
IMO Rust is far more functional than JS, even minus its closure/first-class-function support
Its emphasis on immutability and somewhat purer-than-JS functions, plus its much better iterator support, feel more functional in spirit, while JS just kinda gives you the tools for FP but focuses more on other stuff
but you could make all regular tokens also valid literate tokens
(also maybe rename literate to verbose, since the first thing i think of hearing literate for a language is literate haskell which is... a different principle)
@WheatWizard Your choice is a vacuous truth. Both "the elements of the empty list satisfy my two-neighbor property" and "the elements of the empty list don’t satisfy my two-neighbor property" are both true because the premise that the empty list has any element is false
Both of the following statements are also true "All elements in the empty list satisfy the property" "there are no green ducks in the empty list", but the second one is irrelevantly true.
Once again, both "the elements of the empty list satisfy my two-neighbor property" and "the elements of the empty list don’t satisfy my two-neighbor property" are true
so we should be able to output true or false to the challenge
you made a choice much like how empty products are 1 for convenience, I was just saying it’s not convenient for all answers and it’s boring to deal with it
I accept fully that both the statements "the elements of the empty list satisfy my two-neighbor property" and "the elements of the empty list don’t satisfy my two-neighbor property"
The second statement however, just isn't relevant to the challenge.
> In my experience, if a language problem is hard to solve, most of the head- scratching occurs in the lexer (well, with the exception of C++, which is hard all over)
This is gold
(source: The Definitive ANTLR 4 Reference, chapter 12)
I feel like it would be confusing to have no syntactic difference between single line expressions with implicit return and multi line ones without. You could remove one line but get entirely different behavior
IMO yes, cuz the alternative is to do while (true) { ... if (!condition) break; } but if you try using continue in the middle it's very easy to introduce bugs
CIH, also known as Chernobyl or Spacefiller, is a Microsoft Windows 9x computer virus that first emerged in 1998. Its payload is highly destructive to vulnerable systems, overwriting critical information on infected system drives and, in some cases, destroying the system BIOS. Chen Ing-hau (陳盈豪, pinyin: Chén Yíngháo), a student at Tatung University in Taiwan, created the virus. It was believed to have infected sixty million computers internationally, resulting in an estimated US$1 billion in commercial damages.Chen claimed to have written the virus as a challenge against bold claims of antiviral...
No it wasn't a virus that damaged hardware, it was a DVI port that supposedly warped other DVI cables, which warped other ports the same way, so it spread
@RydwolfPrograms Oh okay so it's as awful as you'd think
SE hasn't supported Gravatar in a while apparently, but Area 51 still does. Area 51 Meta forces you to use Gravatar, like Area 51, but uses the updated code from the rest of Stack Exchange which uses a random/scrambled gravatar ID to prevent your email address from being brute forced
Meaning that there is no way to have a meaningful Area 51 Meta pfp
Also the site often posts things with very questionable veracity, so I wouldn't count on it being true. The site basically just repeats user submissions and people submitting code often lie
There's only finitely many places in the form you can be, but you could sorta create an infinite stack with the back button maybe?
I think it's an FSA without the back button, and if you use the back button you can probably make it semi-TC like CSS where it sorta is but it makes the human do a lot of the work
Anyone have any ideas how I'd byte count a google form
I could make a Google Apps script that serializes all of the available data as JSON, but that feels kind of contrived. Google Drive doesn't let you download forms in any way, and it always shows their size as 1 KB.
Although I now wonder if it is possible to use a Google Form to store arbitrary amounts of data :p
Well I added a few hundred kilobytes of as to the description and it stopped syncing
Maybe I hit some sort of data limit, and I can gradually remove as to establish a baseline data usage, from which other forms' sizes can be calculated relative to this one
Google Forms, 3 sections + 1 question
Try it online!
Google Forms has two features which I believe make it qualify as a (very limited) programming language:
Multiple sections, which allow arbitrary rules for which sections redirect to which, allowing for uncontrolled infinite loops
The ability t...
All it does is arbitrarily restrict what can and can't be used as a language on the site. it's a giant outdated mess. I don't think anybody's paid attention to it for anything other than legitimizing loopholes in like half a decade.
Nobody goes around policing whether or not something uses an approved method because unless it's an egregious enough exploit that it's against the rules anyway, it doesn't matter
We can all pretend it's still something we care about or just...not, and why not go with the second
They're okay I guess. They can be a little annoying sometimes when you just want to use a function you know will return one of the types, but I get why they exist and are useful if there's decent pattern matching available
basically, it depends on the level of verbosity you're okay with
(you are talking about things like Either in Scala, right?)