Skip to content

Symbols vs Sigils #94

Answered by h3rald
ghost asked this question in Q&A
Jan 17, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Right so... A symbol is basically a word that when pushed on the stack it is evaluated and manipulated the stack -- this is fairly easy to understand and let's say it is similar to a function in non-concatenative programming languages.

A sigil is a prefix you put in front of a string, and it is just a shorthand for calling a symbol with one string input value.

System sigils typically use special characters and if you think about it you use them all the time:

 1 :test

Instead of:

 1 "test" define

Or:

 *my-module/my-symbol

Instead of:

 "my-module/my-symbol" invoke

When the string input value contains spaces, you have to use double quote as you would with a string, so:

 !"ls -al"

Then t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant