https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#16...
759 karma · joined February 5, 2020
https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#16...
¹: https://downloads.regulations.gov/ONCD-2023-0002-0020/attach...
foo
.stream()
.filter(x -> x.contains("banned"))
.collect(Collectors.toList());
As an aside, Go conflating lists and views irks me, in part due to what weird semantics it gives to append (e.g. if you have two disjunct slices and append an element to one slice, that might modify the other slice). instructionIsTypeSafe(fadd, Environment, _Offset, NextStackFrame, ExceptionStackFrame) :-
validTypeTransition(Environment, [float, float], float, StackFrame, NextStackFrame),
exceptionStackFrame(StackFrame, ExceptionStackFrame).
Fun fact: Said type system has a 'top' type that is both the top type of the type system as well as the top half of a long or double, as those two actually take two values while everything else, including references, is only one value. Made some sense when everything was 32 bit, less so today.¹: http://www.dkriesel.com/en/blog/2013/0802_xerox-workcentres_...
Edit: Oh, you don't mean in the importing module's globals, you mean `sys.modules`. Yeah that works!
Or don't and don't allow unnecessary ambiguity. For * and +, there's a agreed upon order of operations far more universal than a programming language, but it's sensible to use a partial order so nobody is mistaken about whether e.g. logical or and bitshift binds tighter. Similary C counld have just not have allowed omitting the braces around single-line else clauses and would have been a simpler language for it.
I think that's intentional because that's what Hubris is aimed at.
It is, I just wanted to point out that the term "immutable variable" is sensible. I think a good way to put it is that b is a variable, and when the statement runs a value is bound to b. So the value bound to b varies yet b can be immutable, in contrast to a constant which is a binding to always the same value.
> Did you mean `const b = a;` ?
Fixed, thanks :)
The closes thing there is 7.22.5.2 §4: "If two elements compare as equal, their order in the resulting sorted array is unspecified"
So I'd say blaming users for a bug in glibc isn't fair.
int cmp(const float *a, const float *b) {
if (*a < *b) {
return 1;
} else if (*a == *b) {
return 0;
} else {
return -1;
}
}Careful: In C, memory isn't a huge array of bytes.
Even the Go standard library itself panics (and recovers) when you try to e.g. json-encode a NaN, which doesn't seem like something that should make the system unstable.
Instead we get an entire article about getters and setters, which uses a Java example with pointless getters and setters that just directly read/write a variable.
> Groovy has syntactic support for maps using [] to get and set the value based on the variable within the square brackets
Why variable? Does that mean you can't use expressions for indexing?
System.err.println "Usage: groovy Groovy01.groovy input-file"
System.exit(0)
Why does only the second call need parentheses? String s
s = 42
Looks like Groovy is weakly typed? strParam != null && strParam.isInteger() ? Integer.parseInt(strParam) : 0
Doesn't Groovy already have if-else? Why also add `?:` ?> In the previous article, you learned that Groovy’s version of truth means you don’t need to test for not null
The previous article doesn't even mention the word truth.