Sujet : Re: xkcd.com/353 ( Flying with Python )
De : mats (at) *nospam* wichmann.us (Mats Wichmann)
Groupes : comp.lang.pythonDate : 31. Mar 2024, 19:27:34
Autres entêtes
Message-ID : <mailman.41.1711909694.3468.python-list@python.org>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 3/30/24 10:31, MRAB via Python-list wrote:
On 2024-03-30 11:25, Skip Montanaro via Python-list wrote:
>
https://xkcd.com/1306/
what does SIGIL mean?
>
I think its' a Perl term, referring to the $/@/# symbols in front of
identifiers.
>
I wouldn't consider '@' to be a sigil any more than I would a unary minus.
Nonetheless, Perl folk do use that term, specifically.
"One thing that distinguishes Perl from other languages is its use of sigils; the funny looking symbols placed in front of variable names. "
$ Scalar $foo
@ Array @foo
% Hash %foo
& Subroutine &foo
* Typeglob *foo
> Sigils have many benefits, not least of which is that variables can be interpolated into strings with no additional syntax. Perl scripts are also easy to read (for people who have bothered to learn Perl!) because the nouns stand out from verbs. And new verbs can be added to the language without breaking old scripts.
> Programming Perl, Chapter 1, 4th Edition
etc.