List of Scala’s “magic” functions

As far as I know: Getters/setters related: apply update identifier_= Pattern matching: unapply unapplySeq For-comprehensions: map flatMap filter withFilter foreach Prefixed operators: unary_+ unary_- unary_! unary_~ Beyond that, any implicit from A to B. Scala will also convert A <op>= B into A = A <op> B, if the former operator isn’t defined, “op” is … Read more

Are semicolons optional in Rust?

They’re not optional. Semicolons modify the behaviour of an expression statement so it should be a conscious decision whether you use them or not for a line of code. Almost everything in Rust is an expression. An expression is something that returns a value. If you put a semicolon you are suppressing the result of … Read more

Are semantics and syntax the same?

Syntax is the grammar. It describes the way to construct a correct sentence. For example, this water is triangular is syntactically correct. Semantics relates to the meaning. this water is triangular does not mean anything, though the grammar is ok. Talking about the semantic web has become trendy recently. The idea is to enhance the … Read more

What does “dyn” mean in a type?

TL;DR: It’s a syntax for specifying the type of a trait object and must be specified for clarity reasons. Since Rust 1.0, traits have led a double life. Once a trait has been declared, it can be used either as a trait or as a type: // As a trait impl MyTrait for SomeType {} … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)