Local variables in the "material graph" shader editor

In the material graph, how do you do create and assign values to local variables?

pseudo code:

var a = some_texture;
a = some_different_texture;

It seems absurd that there would be a scripting language, visual or not, that forbid the creation of local variables. It just seems terrible. This super fundamental feature has existed since the beginning of programming. But after spending a while searching, I could not find out how to do this in the material editor.

I think I am going insane. How do you do this?

Hi there,

You can absolutely create local variables if you use a “custom hlsl” node, as in that pseudo code.
The closest you’ll get in the material editor graph, however, is a named reroute- though these can only be assigned once, they can be accessed however many times you need. Think const variable.