Sigil for Function Parameter Names

By Xah Lee. Date:

new crotchet: all function parameter names should start with φ.

Example in emacs lisp:

(defun xah-fix-ellipsis (φstring &optional φfrom φto)
  "Change “...” to “…”.

When called interactively, work on current text block or text selection. (a “text block” is text between empty lines)

When called in lisp code, if φstring is non-nil, returns a changed string.  If φstring nil, change the text in the region between positions φfrom φto."
   (if (region-active-p)
       (list nil (region-beginning) (region-end))
     (let ((bds (get-selection-or-unit 'block)) )
       (list nil (elt bds 1) (elt bds 2)) ) ) )

  (let (workOnStringP inputStr outputStr)
    (setq workOnStringP (if φstring t nil))
    (setq inputStr (if workOnStringP φstring (buffer-substring-no-properties φfrom φto)))
    (setq outputStr (replace-regexp-in-string "\\.\\.\\." "…" inputStr))

    (if workOnStringP
        (delete-region φfrom φto)
        (goto-char φfrom)
        (insert outputStr) )) )

〔➤see Xah Emacs Lisp Tutorial

Example in JavaScript:

function draw_rect (φx_coord, φy_coord, φwidth, φheight) {
    // returns a svg rect element
    var rect = document.createElementNS("", "rect");
    rect.setAttribute("x", φx_coord.toString());
    rect.setAttribute("y", φy_coord.toString());
    rect.setAttribute("width", φwidth.toString());
    rect.setAttribute("height", φheight.toString());
    return rect;

〔➤see JavaScript Tutorial by Example

this is experimental. I'm going to see how it goes.

why do you want to do this?

I want to be able to distinguish function parameters easily from local variables. (and, ideally, also easily distinguish GLOBAL variables. And built-in vs user-defined. And, wish every identifier is unique.) 〔➤see Programing Style: Variable Naming: English Words Considered Harmful

note, the choice of the character takes some consideration. You want a char that is:

note: sigil is mostly popularly associated with perl. But it's also used in PHP and Ruby, as these 2 languages directly borrowed it from Perl. (perl borrowed it from unix shell.) 〔➤see Learn Perl in 1 Hour〕 〔➤see PHP in 1 Hour〕 〔➤see Ruby: Learn Ruby in 1 Hour

The idea of sigil is however quite widespread. Many languages have special chars as starting or ending variable names to indicate special purpose, though, mostly as a convention only, not part of the language machinery. For example, Mathematica variables starting with $ are predefined global special variables. (see:, since 1988.

the name sigil is coined by Philip Gwyn in 1999 to refer to perl's sigil, according to Wikipedia: Sigil (computer programming)