Skip to content
gvx edited this page Apr 13, 2011 · 1 revision

An autonym in Déjà Vu is a variable that has its own ident as value. Examples in the Standard Library are (, ) and ]. (Not [, which is a function.)

One can make an autonym like such:

set 'q' 'q'

This can be useful for a variety of reasons. ((, ) and ] are simple sentinel values, and as such cannot have often-used values. Making them autonyms was an elegant solution, I think.)

A more convenient way to make autonyms would be to define a function:

autonym:
    set dup

autonym 'q'
. = 'q' q #true!

Clone this wiki locally