on master help sign in
rename date example to cjdate example
commita244f5f10fddb1e57376e57def11486b35b79f4e authorAgentM <agentm@themactionfaction.com> dateFri 26 Mar 2021, 12:57 (6 years ago) parenta4b7234
9 files changed+12−10
docs/15_minute_tutorial.markdown+1−1 docs/import_export_csv.markdown+2−2 docs/reaching_out_of_the_tarpit.markdown+1−1 docs/tutd_cheatsheet.markdown+1−1 docs/tutd_tutorial.markdown+1−1 jupyter/TutorialD Notebook Walkthrough.ipynb+1−1 src/bin/ProjectM36/Server/WebSocket/websocket-client.html+1−1 src/bin/TutorialD/Interpreter/Import/BasicExamples.hs+2−2 src/bin/TutorialD/Interpreter/RelationalExpr.hs+2
docs/15_minute_tutorial.markdown+1−1
@@ -28,7 +28,7 @@ Note that TutorialD is strongly-typed- no type coercions take place automaticall
2828### Load the Canonical Chris Date Example
2929
3030```
31−TutorialD (master/main): :importexample date
31+TutorialD (master/main): :importexample cjdate
3232```
3333
3434```:importexample``` (do not skip typing the preceding colon), loads a built-in example schema and executes it to change the state of the database. In this case, the relations "s" (supplier), "p" (product), and "sp" (suppliers-products) are now loaded.
docs/import_export_csv.markdown+2−2
@@ -9,7 +9,7 @@ If a relation variable cannot be exported due to data types which are not suppor
99### Example Export
1010
1111```
12−TutorialD (master/main): :importexample date
12+TutorialD (master/main): :importexample cjdate
1313TutorialD (master/main): :exportcsv s "/tmp/csv"
1414```
1515```
@@ -37,7 +37,7 @@ s#,sname,status,city
3737S6,Samson,100,New York
3838```
3939```
40−TutorialD (master/main): :importexample date
40+TutorialD (master/main): :importexample cjdate
4141TutorialD (master/main): :showexpr s
4242┌──────────┬────────┬───────────┬───────────────┐
4343│city::Text│s#::Text│sname::Text│status::Integer│
docs/reaching_out_of_the_tarpit.markdown+1−1
@@ -57,7 +57,7 @@ Project:M36 implements multiple interfaces:
5757To understand how Project:M36 stacks up against the fictional programming language shown in the paper, we have implemented the [example from the paper](/examples/out_of_the_tarpit.tutd). The language used in the script is a dialect of Chris Date's TutorialD language. It can be loaded into an interactive ```tutd``` session like so:
5858
5959```
60−TutorialD (master/main): :importexample date
60+TutorialD (master/main): :importexample cjdate
6161TutorialD (master/main): :showexpr p
6262┌───────────────────┬────────────┬───────────────────┬────────────┬────────────┐
6363│address::Address │agent::Agent│dateRegistered::Day│photo::Text │price::Price│
docs/tutd_cheatsheet.markdown+1−1
@@ -47,7 +47,7 @@ Database context expressions take the current database context as input and alte
4747
4848|Database Context Expression |Description |
4949|------------------------------------------------------|---------------------------------------|
50−|`:importexample date`|Imports a precooked schema from Chris Date's books resulting in relvars `s`, `sp`, and `p`|
50+|`:importexample cjdate`|Imports a precooked schema from Chris Date's books resulting in relvars `s`, `sp`, and `p`|
5151|`newrelvar:=relation{tuple{age 3}}`|Assign a new relation variable named `newrelvar`|
5252|`undefine s`|Remove a relation variable|
5353|`insert s relation{tuple{city "Boston",s# "S10",sname "Gonzalez",status 10}}`| Append to an existing relation variable with another relational expression|
docs/tutd_tutorial.markdown+1−1
@@ -19,7 +19,7 @@ TutorialD (master/main):
1919The examples in this tutorial can be executed after loading Chris Date's sample relations using:
2020
2121```
22−:importexample date
22+:importexample cjdate
2323```
2424
2525Each section assumes a fresh instance of the Date examples. The relation variables created in the script are:
jupyter/TutorialD Notebook Walkthrough.ipynb+1−1
@@ -38,7 +38,7 @@
3838 }
3939 ],
4040 "source": [
41− ":importexample date"
41+ ":importexample cjdate"
4242 ]
4343 },
4444 {
src/bin/ProjectM36/Server/WebSocket/websocket-client.html+1−1
@@ -126,7 +126,7 @@ margin-bottom: 5pt;
126126 <li>:showrelvars</li>
127127 <li>:showexpr true</li>
128128 <li>:showexpr false</li>
129− <li>:importexample date</li>
129+ <li>:importexample cjdate</li>
130130 <li>:showexpr s join sp</li>
131131 <li>update s where city=&quot;Paris&quot; (status:=10)</li>
132132 <li>:showexpr s</li>
src/bin/TutorialD/Interpreter/Import/BasicExamples.hs+2−2
@@ -20,8 +20,8 @@ importBasicExampleOperatorP :: Parser ImportBasicExampleOperator
2020importBasicExampleOperatorP = do
2121 reservedOp ":importexample"
2222 example <- identifier
23− if example == "date" then
23+ if example == "cjdate" then
2424 pure ImportBasicDateExampleOperator
2525 else
2626 fail "Unknown example name"
27−
27+
src/bin/TutorialD/Interpreter/RelationalExpr.hs+2
@@ -212,10 +212,12 @@ atomExprP = consumeAtomExprP True
212212consumeAtomExprP :: RelationalMarkerExpr a => Bool -> Parser (AtomExprBase a)
213213consumeAtomExprP consume = try functionAtomExprP <|>
214214 try (parens (constructedAtomExprP True)) <|>
215+ try (parens relationalAtomExprP) <|>
215216 constructedAtomExprP consume <|>
216217 attributeAtomExprP <|>
217218 try nakedAtomExprP <|>
218219 relationalAtomExprP
220+
219221
220222attributeAtomExprP :: Parser (AtomExprBase a)
221223attributeAtomExprP = do