Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^6: Shouldn't references be readonly?

by LanX (Cardinal)
on Aug 05, 2020 at 22:11 UTC ( #11120375=note: print w/replies, xml ) Need Help??


in reply to Re^5: Shouldn't references be readonly?
in thread Shouldn't LITERAL references be readonly? (updated)

you are aware that "constructor" isn't even mentioned in your definition? ;)

calling [$a] a "literal constructor" is not far fetched.

a non literal construction is in contrast to do { @a=($a); \@a } because it involves a variable.

This it meets the definitions in perlglossary ("no variable") and is also mirrored in JS terminology which has 100% the same semantic.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^7: Shouldn't references be readonly?
by jcb (Vicar) on Aug 05, 2020 at 22:18 UTC
    you are aware that "constructor" isn't even mentioned in your definition? ;)

    Yes, that is what I misremembered: perlref calls them "composers" but they act just like constructors. :-)

    Calling it a "constructor" is a hint that it does something at runtime, instead of being a literal embedded into the program text. That its return value is mutable should not be a surprise.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11120375]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2020-10-29 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (271 votes). Check out past polls.

    Notices?