http://proglit.com/. a first language by sa pigeon (a “fake” language)
TRANSCRIPT
![Page 1: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/1.jpg)
http://proglit.com/
![Page 2: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/2.jpg)
a firstlanguage
![Page 3: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/3.jpg)
BY
SA
![Page 4: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/4.jpg)
![Page 5: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/5.jpg)
pigeon(a “fake” language)
![Page 6: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/6.jpg)
source code(code as text)
![Page 7: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/7.jpg)
commentthis is code # this is a comment
![Page 8: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/8.jpg)
value(a piece of data)
![Page 9: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/9.jpg)
data typesnumber
stringboolean
![Page 10: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/10.jpg)
number3
-7248.93
-0.88881
![Page 11: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/11.jpg)
string(a piece of text)
“R. Nixon”“T”
“Elementary, my dear Watson.”“%”
![Page 12: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/12.jpg)
boolean(a true/false value)
truefalse
![Page 13: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/13.jpg)
null(a value representing nothing)
null
![Page 14: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/14.jpg)
literal(a value written in code)
null“The owls are not what they seem.”
78false
![Page 15: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/15.jpg)
escape sequence“\”Hi,\” she said.”“Hello,\nworld.”
“c:\\bla\\bla\\bla”
![Page 16: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/16.jpg)
operation(takes input values and
returns an output value)
![Page 17: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/17.jpg)
operator
(an input value)operand
(specifier of the operation to perform)
![Page 18: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/18.jpg)
(+ 3 5)(3 + 5)
![Page 19: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/19.jpg)
(3 + 5)(add 3 5)
![Page 20: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/20.jpg)
3 + 5 + -7 + 11(add 3 5 -7 11)
![Page 21: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/21.jpg)
11 - 2 * 311 - (2 * 3)
(sub 11 (mul 2 3))
![Page 22: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/22.jpg)
variable(a memory location holding a value)
![Page 23: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/23.jpg)
identifier(a name)
NewYorkfoo
asdf43qwerty78
illegal:New Yorkf^$o*o43asdf
![Page 24: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/24.jpg)
(letter case matters)
NewYorknewyorknewYORKnEwYoRkNEWYORK
case sensitive
![Page 25: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/25.jpg)
reserved word(an identifier reserved by the language)
add, sub, mul, div, if, while…
![Page 26: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/26.jpg)
(gives a variable a value)assignment
as dog trueas newt -87.2as bird null
as cat “rubber baby buggy bumper”
![Page 27: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/27.jpg)
as bar 19as foo baras bar 3as fizz (add foo 11)
![Page 28: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/28.jpg)
expression(evaluates into a value)
null(add foo 2)
“hello”bar
![Page 29: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/29.jpg)
statement(the units of syntax that make up the code)
as foo 53(add foo 11)
![Page 30: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/30.jpg)
computer(a cpu, memory, and i/o)
![Page 31: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/31.jpg)
cpu(executes instructions)
![Page 32: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/32.jpg)
memory(holds bits)
![Page 33: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/33.jpg)
i/o(input/output)
![Page 34: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/34.jpg)
(display a value on the screen)print
(print “wakka wakka”)as bar 19(print bar)
![Page 35: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/35.jpg)
(return typed input from user)prompt
as foo (prompt)(print foo)
![Page 36: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/36.jpg)
Hello, world!(print “Hello, world!”)
![Page 37: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/37.jpg)
(equality test)eq
(eq “moo” “moo” “moo”) # true(eq -35 -35) # true(eq 6 2) # false
![Page 38: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/38.jpg)
(reverse the truth value)not
(not true) # false(not false) # true
![Page 39: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/39.jpg)
(maybe do something, or maybe skip over it)
conditional execution
![Page 40: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/40.jpg)
(“run these statements if…”)if
if condition body
![Page 41: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/41.jpg)
if (eq x 3) (print “cat”) (print “dog”) (print “bird”) x equals 3 cat dog bird
x doesn’t equal 3 bird
![Page 42: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/42.jpg)
(do one thing or do the other, but NOT both)
mutual exclusion
![Page 43: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/43.jpg)
if (eq x 3) (print “hi”)if (not (eq x 3)) (print “bye”)
x equals 3 hix doesn’t equal 3 bye
![Page 44: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/44.jpg)
(“…elsewise, run these other statements”)else
if condition body1else body2
![Page 45: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/45.jpg)
if (eq x 3) (print “hi”)else (print “bye”) x equals 3 hi
x doesn’t equal 3 bye
![Page 46: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/46.jpg)
if (eq x 3) (print “hi”)else if (eq x 5) (print “bye”)
x equals 3 hix equals 5 bye
x doesn’t equal 3 or 5
![Page 47: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/47.jpg)
(a convenience for else if)elif
if condition1 body1elif condition2 body2
![Page 48: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/48.jpg)
if (eq x 3) (print “hi”)elif (eq x 5) (print “bye”) x equals 3 hi
x equals 5 byex doesn’t equal 3 or 5
![Page 49: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/49.jpg)
if (eq x 3) (print “hi”)elif (eq x 5) (print “bye”)elif (eq x -7) (print “moo”)elif (eq x 14) (print “woof”)
x equals 3 hix equals 5 bye
x equals -7 moox equals 14 woof
x doesn’t equal any of these values
![Page 50: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/50.jpg)
if (eq x 3) (print “hi”)elif (eq x 5) (print “bye”)elif (eq x -7) (print “moo”)else (print “meow”)
x equals 3 hix equals 5 bye
x equals -7 moox doesn’t equal any of these values meow
![Page 51: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/51.jpg)
(less than)lt
(lt 25 76 8000) # true(lt 35 -2) # false(lt 2 2 7) # false
![Page 52: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/52.jpg)
(less than or equal to)lte
(lte 25 76 8000) # true(lte 35 -2) # false(lte 2 2 7) # true
![Page 53: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/53.jpg)
(greater than)gt
(gt 25 76 8000) # false(gt 35 -2 -10) # true(gt 8 4 4) # false
![Page 54: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/54.jpg)
(greater than or equal to)gte
(gte 25 76 8000) # false(gte 35 -2 -10) # true(gte 8 4 4) # true
![Page 55: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/55.jpg)
(“are all of the operands true?”)and
(and true true) # true(and true false false) # false(and true false true) # false(and false false) # false
![Page 56: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/56.jpg)
(“is at least one of the operands true?”)or
(or true true) # true(or true false false) # true(or true false true) # true(or false false) # false
![Page 57: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/57.jpg)
(modulus, the remainder of division)mod
(mod 15 5) # 0(mod 16 5) # 1(mod 17 5) # 2
![Page 58: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/58.jpg)
if (eq (mod x 2) 0) (print “even”) else (print “odd”)
![Page 59: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/59.jpg)
(a piece of code that repeats)loop
![Page 60: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/60.jpg)
(“repeatedly execute these statements while…”)while
while condition body
![Page 61: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/61.jpg)
as z 6while (gt z 0) (print z) as z (sub z 1)
6 5 4 3 2 1
![Page 62: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/62.jpg)
fizzbuzzprint the integers 1 to 100, except…
a) for any integer evenly divisible by 3, print “Fizz”b) for any integer evenly divisible by 5, print “Buzz”c) for any integer evenly divisible by 3 and 5, print “FizzBuzz”
![Page 63: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/63.jpg)
as x 1while (lte x 100) … as x (add x 1)
![Page 64: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/64.jpg)
as x 1while (lte x 100) as by3 (eq (mod x 3) 0) as by5 (eq (mod x 5) 0) … as x (add x 1)
![Page 65: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/65.jpg)
as x 1while (lte x 100) as by3 (eq (mod x 3) 0) as by5 (eq (mod x 5) 0) if (and by3 by5) (print “FizzBuzz”) elif by3 (print “Fizz”) elif by5 (print “Buzz”) else (print x) as x (add x 1)
![Page 66: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/66.jpg)
if by3 (print “Fizz”)elif (and by3 by5) (print “FizzBuzz”)elif by5 (print “Buzz”)else (print x)
if (and by3 by5) (print “FizzBuzz”)elif by3 (print “Fizz”)elif by5 (print “Buzz”)else (print x)
![Page 67: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/67.jpg)
(a programmer-defined operation)function
routine, sub-routine, procedure, method
![Page 68: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/68.jpg)
(foo true 31)
![Page 69: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/69.jpg)
function name parameters body
![Page 70: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/70.jpg)
function eric (print “hello”)
(eric) # print “hello”
![Page 71: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/71.jpg)
argument
parameter(an input value to a function)
(a variable which receives an input value)
![Page 72: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/72.jpg)
function ryan bat goat (print (sub goat bat))
(ryan 4 -9) # print -13as bar 3(ryan bar 5) # print 2
![Page 73: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/73.jpg)
(return a value from the function)return
return expression
![Page 74: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/74.jpg)
function jerry return 3
(print (jerry)) # print 3
![Page 75: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/75.jpg)
factoriala) for 0, return 1b) for positive n, return product of 1..n
![Page 76: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/76.jpg)
function factorial n as val 1 while (gt n 1) as val (mul n val) as n (sub n 1) return val
(factorial 4) # 24(factorial 5) # 120
![Page 77: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/77.jpg)
(Don’t Repeat Yourself)DRY
![Page 78: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/78.jpg)
do one thing
keep it short
![Page 79: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/79.jpg)
(place and time which in a thing exists)scope
![Page 80: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/80.jpg)
function kate cat dog as bird 4 return (add cat dog bird)
![Page 81: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/81.jpg)
(a “space” in which a set of names exist)
namespace
(the ambiguity of a name having more than one meaning in a single namespace)
namespace collision
![Page 82: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/82.jpg)
function miguel apple orange as coconut “hi” …
function colin sofa coconut …
![Page 83: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/83.jpg)
function harry …
function lisa harry …
![Page 84: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/84.jpg)
(exists everywhere in the program)
global
![Page 85: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/85.jpg)
function alison (print cat)
function jason x as cat x
as cat “rubber”(alison) # print “rubber”(jason “glue”)(alison) # print “glue”
![Page 86: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/86.jpg)
functions are values
![Page 87: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/87.jpg)
function gina (print “hi”)
as dog gina(dog) # print “hi”
![Page 88: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/88.jpg)
function gina (print “hi”)
function harry turtle (turtle)
(harry gina) # print “hi”
![Page 89: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/89.jpg)
function gina (print “hi”)
function harry turtle (turtle)
function alec cow if cow return harry else return gina
![Page 90: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/90.jpg)
(defined in terms of itself)
recursive
(a function which calls itself)
recursive function
![Page 91: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/91.jpg)
function jessica (print “hi”) (jessica)
(jessica) # print “hi hi hi hi hi…”
![Page 92: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/92.jpg)
function kelly (print “a”) (mike)
function mike (print “b”) (kelly)
(kelly) # print “a b a b a b a b…”
![Page 93: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/93.jpg)
factorial (recursive)a) for 0, return 1b) for n, return product of 1..n
![Page 94: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/94.jpg)
function factorial n if (eq n 0) return 1 return (mul n (factorial (sub n 1)))
![Page 95: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/95.jpg)
as name1 “George Washington”as name2 “John Adams”as name3 “Thomas Jefferson”as name4 “James Madison”as name5 “James Monroe”…
![Page 96: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/96.jpg)
(print name1)(print name2)(print name3)(print name4)(print name5)…
![Page 97: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/97.jpg)
(a value made up of multiple values)
collection
![Page 98: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/98.jpg)
(a numerically-indexed collection)list
(list 77 “yo” -6)(list)
![Page 99: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/99.jpg)
(return the value of the nth item in a list)
get
as will (list 77 “yo” -6)
(get will 0) # 77(get will 1) # “yo”(get will 2) # -6
![Page 100: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/100.jpg)
(return the number of items in a list)len
as josh (list 77 “yo” -6)as lisa (list 77)
(len josh) # 3(len lisa) # 1
![Page 101: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/101.jpg)
function printAll lst as i 0 while (lt i (len lst)) (print (get lst i)) as i (add i 1)
![Page 102: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/102.jpg)
(unable to change)immutable
(able to change)mutable
![Page 103: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/103.jpg)
(change the value of the nth item in a list)
set
as kim (list 77 “yo” -6)
(print (get kim 1)) # print “yo”(set kim 1 -53)(print (get kim 1)) # print -53
![Page 104: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/104.jpg)
(add more items to end of a list)append
as hugh (list)(len hugh) # 0(append hugh “hi” “bye”)(len hugh) # 2(append hugh 3 6)(len hugh) # 4
![Page 105: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/105.jpg)
reference variable(holds an address, NOT a value)
![Page 106: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/106.jpg)
as zed 3as zed 5as molly (sub zed 1)
![Page 107: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/107.jpg)
as leo (list)as bruce leo(len leo) # 0(append bruce “salut”)(len leo) # 1
![Page 108: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/108.jpg)
function ian lst (append lst null)
as chris (list 71 false)(len chris) # 2(ian chris)(len chris) # 3
![Page 109: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/109.jpg)
as joe (list “hi” 8)as yves (list joe 4 null)(set yves 2 yves)
![Page 110: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/110.jpg)
(a value in memory is identicalwith only itself)
identity
(a value in memory is equal to itself and other values of same type and content)
equality
![Page 111: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/111.jpg)
(identity test)id
as ed (list 88 8)as thom (list 88 8)(eq ed thom) # true(id ed thom) # false
![Page 112: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/112.jpg)
(a key and its associated value)key-value pair
(a value that acts as an index to another value)
key
![Page 113: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/113.jpg)
(an associative collection)dictionary
(dict)(dict 77 “yo” “avast” true)(dict “avast” true 77 “yo”)
![Page 114: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/114.jpg)
as ted (dict 5 2 “yo” -1)(len ted) # 2(get ted “yo”) # -1(set ted “yo” 8)(len ted) # 2(get ted “yo”) # 8(set ted 21 false)(len ted) # 3
![Page 115: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/115.jpg)
as cow (dict)as goose cow(set cow “name” “Fred”)(get goose “name” “Fred”) # “Fred”
![Page 116: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/116.jpg)
function makePerson name age ss return (dict “name” name “age” age “ss” ss)
as mike (makePerson “Mike Smith” 43 555555555)
![Page 117: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/117.jpg)
what’s wrong with pigeon?
![Page 118: Http://proglit.com/. a first language BY SA pigeon (a “fake” language)](https://reader037.vdocuments.mx/reader037/viewer/2022110206/56649ce55503460f949b2ee9/html5/thumbnails/118.jpg)
http://proglit.com/