Skip to content

Commit 40cd668

Browse files
authored
Remove std.lang dependency (#235)
* ys * remove std.lang dependency
1 parent f20ac17 commit 40cd668

File tree

3 files changed

+10
-4369
lines changed

3 files changed

+10
-4369
lines changed

deps.edn

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@
6464
yamlscript/core {:git/url "https://github.com/yaml/yamlscript"
6565
:git/sha "ed7adfbf90a39f379d5a7193bb2e4bdd7f0eecf8"
6666
:deps/root "core"}
67-
68-
xyz.zcaudate/std.lang {:mvn/version "4.0.9"}
69-
xyz.zcaudate/rt.basic {:mvn/version "4.0.9"}
7067
}
7168

7269
:mvn/repos {"osgeo" {:url "https://repo.osgeo.org/repository/release/"}}

src/mentat_collective/emmy/fdg_ch01_ys.clj

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@
5959
(kind/scittle
6060
'(def time first))
6161

62-
^:kindly/hide-code
63-
(kind/scittle
64-
'(def D partial))
65-
6662
;; The Clojure code below is taken from a [previous Civitas entry](https://clojurecivitas.github.io/mentat_collective/emmy/fdg_ch01.html) (the picture from [Emily's parser game](https://ifdb.org/viewgame?id=urxrv27t7qtu52lb)).
6763

6864
;; It is not necessary to understand what the Clojure code does. As this semantics does not matter here, it is rather the syntax, the notation, that should be compared and given attention to.
@@ -110,28 +106,27 @@ defn sphere-to-R3(R):
110106
(def of call)
111107
(def at call))
112108

113-
(def D partial)
114109

115110
(ys "
116111
defn F-to-C(F):
117112
fn(state):
118113
up:
119114
time: state
120115
F: state
121-
D(0).of(F).at(state) +:
122-
D(1).of(F).at(state) *
116+
partial(0).of(F).at(state) +:
117+
partial(1).of(F).at(state) *
123118
velocity(state)
124119
")
125120

126-
;; Again, the above `+:` is normal addition. With `of` and `at` like that, the above `D(0).of(F).at(state)` (which means "take the zeroth derivative of the function F at point state") translates into what are higher order functions in the Clojure version.
121+
;; Again, the above `+:` is normal addition. With `of` and `at` like that, the above `partial(0).of(F).at(state)` (which means "take the partial derivative with respect to the first variable of the function F at point state") translates into what are higher order functions in the Clojure version.
127122

128123
(kind/scittle
129124
'(defn F->C [F]
130125
(fn [state]
131126
(up (time state)
132127
(F state)
133-
(+ (((D 0) F) state)
134-
(* (((D 1) F) state)
128+
(+ (((partial 0) F) state)
129+
(* (((partial 1) F) state)
135130
(velocity state)))))))
136131

137132
;; ## Another one
@@ -150,7 +145,7 @@ defn Lsphere(m R):
150145

151146
;; ## The proof is in the pudding
152147

153-
;; Emmy is a symbolic algebra system, `m:q` produces a symbol named `m`.
148+
;; Emmy is a symbolic algebra system, `s:q` as well as `q: s` produce the symbol named `s`. Below we have `m:q` and `q: t` to produce the symbols `m` and `t`.
154149

155150
^:kindly/hide-code
156151
(defmacro q [s] (list 'quote s))
@@ -159,7 +154,7 @@ defn Lsphere(m R):
159154
simplify:
160155
Lsphere(m:q R:q):
161156
up:
162-
=>: t:q
157+
q: t
163158
up: theta:q phi:q
164159
up: thetadot:q phidot:q
165160
")
@@ -255,7 +250,7 @@ L =: Lc(m:q the-metric R2-rect)
255250
simplify:
256251
L:
257252
up:
258-
=>: t:q
253+
q: t
259254
up: x:q y:q
260255
up: vx:q vy:q
261256
")

0 commit comments

Comments
 (0)