Hal9000
Variables leaking
I’ve been thinking about the change made 2-3 years ago where it’s
no longer permitted to set variables inside a case statement (or similar).
Is it fair to summarize this by saying: Variable values can pass from an
outer context to a more inner one, but those variables cannot be bound
to new values (such that the outer context changes)?
This afaik applies to any “block” of code nested inside a larger context –
the “guts” of an if, case, cond, code passed to a macro…
Am I looking at this correctly or not?
Hal
First Post!
hauleth
In short ways, binding is valid only within it’s block.
x = 1
if true do
# we start new block there
x = 2
# there `x` has new binding
end # block ended so all it's bindings as well
# there `x` has meaning of it's previous binding
Popular in Discussions
Hello everyone,
I’m so glad to have discovered this awesome community. Thanks for creating it! This is my second post, and apologies for...
New
Elixir Upgrading is so Simple in Ubuntu and It worked for me
Ubuntu 16.04
git clone https://github.com/elixir-lang/elixir.git
cd elixir...
New
Hi all,
I am trying to convince my team to use liveview over the current react. What are some of the points where one should consider us...
New
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in.
phx.gen...
New
https://nitter.net/josevalim/status/1744395345872683471
https://twitter.com/josevalim/status/1744395345872683471
New
What learn first? Rust or Elixir
Hi Elixir community!
I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
After doing a port from a c++ library to my project in phoenix I’ve seen that I need a faster way to run this algorithm and I found this ...
New
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them?
Feel free to be as concise or in-depth as you li...
New
Hey there,
It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
Got a question about when to concat vs. prepending items to list then reversing to achieve appending.
So i know lists boil down to [1 | ...
New
Other popular topics
Hello everyone,
I try to use an Javascript Event Handler in my root.html.leex file.
Therefore I created a function in the app.js file: ...
New
If I have a post route which an argument:
post /my_post_route/:my_param1, MyController.my_post_handler
How would get the post params ...
New
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help.
Where are they similar?
Where do they differ the m...
New
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Hi folks,
Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
Hi,
I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New








