editor


tutorial




Logoi Tutorial (Part III):
Variables


"Plus ça change, plus c'est la même chose."

"The more it changes, the more it's the same thing."

proverbe français




;
; What is a variable?
;

;
; A variable is a symbol which refers to another value.
;




;
; Letters = Mathematical Variables
;

Names/Value
X
1
Y
2
Z
3
alert!/String
string/Natural
+
X
Y
Z

Name/Value
alpha-beta-lambda/Real/Real/Real
Function/3
α
β
λ
*
λ
+
α
β

;
; Double::Colons = Optional Type Indicator
;

age::Natural

bank-balance::Rational

X::Complex

;
; Skewer-Casing = Scheme/Lisp Variable Names
;

Name/Value
first-name
"Alonzo"

Name/Value
favorite-color
"Lavender"

Name/Value
list-of-nuclear-codes
list/Naturals
2592999782854
3491699487473
1870700852778
2149457461371
8100496886063

;
; CapitalizedWord = Type
;

Text

String

Character::String

Number

Rational::Number

Natural::Rational::Number

Alphanumeric::String

IPv4Address::String

IPv6Address::String

;
; CapitalizedPlural = List::Type(s)
;

Strings::List

Alphanumerics::List

Booleans::List

XYTuples::List

IPv6Addresses::List

;
; Paired/Types = Syntactic Sugar
;

Name/Value

Names/Value

if/yes/no

try/catch/else/finally

Function/1

Function/2

Function/3

;
; <Angle/Brackets> = HTML Elements
;

<div>

<li>

<script>

<style>

;
; Question-Marks? = Truth-Value Predicates
;

macro-mode-enabled?

equal?/Rational/Rational

all?/Booleans




Next: functions