-
-
Notifications
You must be signed in to change notification settings - Fork 4
sigil
Sigils are those ugly often unspeakable special chars (!@#$%^&*[}...) of other languages
The Angle programming language strives to avoid all sigils (operator symbols / signs)
this seems ironic since the underlying data format wasp heavily relies on structured braces for trees. The main insight is that these trees can be represented completely without braces with indentation:
a{b;(c,d,e)}
is equivalent to
a
b
c d e
whichever visual representation one prefers is completely a matter of taste and has nothing to do with the language itself. unfortunately this brings up the old debate about spaces versus steps but thanks to modern IDEs this has become much less of a problem and Angel is agnostic about this preference that's about any other preferences in syntactic representation because the Underlying structure remains identical.
in fact one can freely mix these two representations. depending on context One might be preferable over the other, for example in mathematical context the first representation is of more readable whereas in natural language context the second representation has its charms.
and most importantly the second representation is the canonical way to input code or data if one uses speech recognition.
similarly as for brackets and braces there is always an equivalent keyword for sigil operators:
& sigil for function pointer
map &square [1 2 3] == [1 4 9]
can be written without '&' as
map function square on [1 2 3] == [1 4 9]
or just as
square [1 2 3] == [1 4 9]
via universal broadcasting
The equivalent keywords for sigil operators have the exact same precedence associativity etc:
2+3×4==14
two plus three times four is fourteen
Siri already outputs the mathematical version and it is much easier to read, however there are situations in which one or more of the keywords are not input as symbols or operators. For example writing pi on a keyboard is easier than typing π.
in modern IDEs one can switch between these different representations with linter formatters, a special pragma May be desired for code where the format should not be automatically modified.