Dagger Lang

Introduction

Main Documentation:


Working with Dagger
Dagger Values
User Input

Builtin Functions:


Lambda
Set
Put
List
Head
Tail
Eval
Join
Addition
Subtraction
Multiplication
Division
Modulo
Power
If
Equals
Not Equal
Greater Than
Less Than
Greater Than or Equal
Less Than or Equal
Read Integer
Read Decimal
Read String
Load
Error
Print

Builtin Set


The set function is used to create a variable in the global environment (scope). It takes two arguments, a Q-Expression containing the name of the variable, and the value of the variable (the type depends on what type of variable you want it to be). It can also be used to bind functions to symbols, as demonstrated in the previous page.

Use



    set {name} value

Examples


We will declare a variable called myFavoriteNumber and set it to 6:


    dagger> set {myFavoriteNumber} 6
    ()
    dagger> myFavoriteNumber
    6

The symbol "myFavoriteNumber", is now bound to the number 6, whenever we call myFavoriteNumber, it returns 6.