about summary refs log tree commit diff stats
path: root/src/tmp.lil
blob: 2954867b432758dbc05410a306da67f49a860386 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# lil includes a fun query system as well as language features for both
# functional programming and vector programming -- this invites interesting
# opportunities for applications built around little databases/datasets and
# the manipulation and querying of that data! 

# I'm not 100% certain what I'm going to build with these features, yet, but
# I will use this as a space to explore what lil has to offer.

people.name:"Alice","Sam","Thomas","Sara","Walter"
people.age:25,28,40,34,43
people.job:"Chef","Sous Chef","Baker","Front of house","Baker"
people:table people

t:select from people

show[t]

s:select where ("S%m" parse name) from people

show[s]

d:select where ("Baker" = job) from people

show[d]

a:select name where ("Alice" = name) from people

show[a]

w:update job:"Amazing Chef" where job = "Chef" from people

Show[w]

l:insert name:"John" job:"Critic" age:32 into people

show[l]

# save:writecsv[l "sis" ","] # where sis formats the column type, here string integer string -- the other option is boolean. 

# write["test.csv" save]

on cons x y do
	x,y
end

breakfast: insert food:("Eggs","Pancakes","Grapefruit") quantity:(3,4,1) tasty:(1,1,0) into 0 # NOTE, 0 here could also be the name of the variable, so, in this example, breakfast

show[breakfast]