Jump to content

Talk:Sigil (computer programming)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Widefox (talk | contribs) at 10:35, 14 September 2016 (Assessment: Computing: class=C, importance=Low, software=y, software-importance=Low (assisted)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing: Software C‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
CThis article has been rated as C-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Software (assessed as Low-importance).

Template:Findsourcesnotice "In the PHP language, which was largely inspired by Perl" <--- uhh, what? I can't see any resemblence between PHP or Perl...


Quote:

This is the source of the long tradition of using "i", "j", "k" etc as the loop indexes of "for loops" in many programming languages—few of which have implicit typing).

It seems like this comes from math instead. As in, x sub i and x sub j

There is one thing that I find confusing about this article. In the second paragraph it is stated that Perl's sigils were adopted from the shell sigils. On the other hand, the first paragraph of Language comparision state that the $ in shell scripting is not a sigil. Isn't that a contradiction?

BernhardSchmalhofer (talk) 19:22, 27 March 2010 (UTC)[reply]


“$” precedes any variable name: I'd say it's an operator as in shell scripts. If $a is 1234, $ref is 'a' then $$ref is 1234. Which is understandable, because in PHP simply writing 'test' (without $ or quotes) means the string 'test' (if there's no constant defined as 'a')

--Terrakotta (talk) 10:11, 23 September 2010 (UTC)[reply]

Shell scripting, operator or not?

This page is confused as to whether shell scripting's '$' is a sigil or an operator. Historical context says "Larry Wall adopted shell scripting's use of sigils for his Perl programming language." but Similar phenomenon says "In Unix shell scripting and in utilities such as Makefiles, the "$" is a unary operator that translates the name of a variable into its contents. While this may seem similar to a sigil, it is properly a unary operator for lexical indirection, similar to the * indirection operator for pointers in C, as noticeable from the fact that the dollar sign is omitted when assigning to a variable." — Preceding unsigned comment added by 68.227.46.192 (talk) 03:49, 12 December 2013‎ (UTC)[reply]

Yes, the $ operator is not a sigil. It means "what follows is special expansion syntax". Variables do not inherently have sygils. Witness:
FOO=123       # no "sigil" in assignment
export FOO    # none here either
unset FOO     # nor here
echo $FOO     # In expansion, distinguishes ordinary word FOO from variable
echo ${FOO}   # Alternative
VAR=$(ls -l)  # $(...) denotes process expansion
The $ character is not some superfluous sigil, but a necessary escape which indicates that what follows has special meaning. This allows most of a shell command line to be literal text that is minimally processed by breaking into words.

24.85.131.247 (talk) 05:46, 26 January 2014 (UTC)[reply]

Nonsense about Lisp

In the "earmuffs" convention, the asterisks do not surround a variable name in any sense. They are part of the symbol name. They are not a sigil any more than C is a sigilon class names in the Microsoft Foundation Classes or ATL, or _t is a sigil in some C typedef names.

Look:

$ clisp -q
[1]> (symbol-name '*standard-output*)
"*STANDARD-OUTPUT*"

The name of the *standard-output* symbol is the character string "*STANDARD-OUTPUT*", asterisks and all.

The first paragraph of the article makes it clear that sigil is "attached to" a name. Something part of a name isn't attached to a name.

24.85.131.247 (talk) 05:50, 26 January 2014 (UTC)[reply]