Don't ask to ask, just ask | |
PerlMonks |
Re^9: Thx, St. Larry, for the Beauty of Sigilsby LanX (Saint) |
on Jul 27, 2019 at 15:41 UTC ( [id://11103511]=note: print w/replies, xml ) | Need Help?? |
Well yes that's how it's implemented in Perl - and other languages like Python or JS too - but doesn't help comparing languages. They all store references into their "namespaces" or "lexical pads" Perl for instance does a *array= [1,2,3] to create a package variable accessible as @array ° Python and JS do essentially* the same thing!!! Only the syntax to access and operate those variables is different. the following is legal² JS code ³
and "anonymous" only refers to the literal [array] or {hash} constructors not to the scalar on the LHS of an assignment. The difference is not "named" or "unnamed", but explicit or implicit dereferencing. If anything, references are the "plain" fundamental thing..
Cheers Rolf
°) or scalars, but this can't be easily written *scalar = \1 is not the same thing *) JS has primitive values (read scalar) and objects (read blessed references), there is no explicit referencing only implicit. ²) JS has no sigils $ is a legal part of an identifier to allow "machine translations", jQuery is messing with that. ³) updated and extended
In Section
Meditations
|
|