Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@johnmelodyme Okay I am back. Didn’t finish, too long of a read to be done as a quickie.
What the fuck is assignment operator’s deal? Pattern matching what?! -
@johnmelodyme What? What are you saying? I need answers man! I asked questions! Gimme answers!
-
Yes and no. All I did is take the input parameters and rotate the char with certain int .
-
@johnmelodyme The assignment operator “=“. It’s mentioned in the site linked above that it is not an assignment operator at all.
-
So that's what makes the rabbit jump, glad i don't have to deal with that too much :-)
-
@Cyanide @johnmelodyme Erlang "assignment" is more like logical unification rather than classic assignment where you transfer something from one box in memory to another. https://en.m.wikipedia.org/wiki/...
It basically tries to look at the LHS and the RHS and figure out what the variables should be to make them equal, including inside data structures like tuples and lists.
And of course, once you've figured out what a variable should be, you can't change it, so it acts like a proxy (or another "name") for a value (because it's a "variable" only in the sense that you don't know what it is pre-unification, like a variable in maths). This is similar to "variables" in functional programming languages with immutability.
All this is because Erlang grew out of Prolog, a logic programming language. It feels completely natural if you've tried logic programming, but sadly it isn't all that popular. Although, apart from this and some other stuff (the wonky syntax is also from Prolog), Erlang is more like a conventional FP language. -
@RememberMe Thanks for the explanation man! I still don’t understand it fully but thanks for taking the time to write out!
-
@bittersweet Erlang and Prolog predate Haskell. Prolog even predates standard ML. But yeah.
-
@RememberMe Well no that's not correct, Haskell predates all programming languages and even the ENIAC, because he was born in 1900. 🤷ðŸ¤
-
@bittersweet "meh"
Allow me to introduce you to a certain Mr. Erlang (yes, the language was named both for him, because Erlang was designed for telecom switches, and for being developed at Ericsson)
https://en.m.wikipedia.org/wiki/...
Born: 1 January 1878 :p -
Awlex177453yerlang gets to use div and rem between 2 arguments? I wanna do that in Elixir as well!
Related Rants
Just in case anyone wonder how Erlang looks like.... Well here's a Caesar cipher programme.
rant
cipher
erlang