Skip to content

Commit

Permalink
Updated exports
Browse files Browse the repository at this point in the history
  • Loading branch information
EXPORTS-bot committed Aug 19, 2023
1 parent b24f2cf commit 03ee3c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion exports/export.compact.edn
Original file line number Diff line number Diff line change
Expand Up @@ -24103,7 +24103,7 @@
";;define F1Car record\n(defrecord F1Car [team engine tyre oil])\n\n;;build the constructor distructing a single map with options\n(defn make-f1team [f1-team f1-engine {:keys [f1-tyre f1-oil] :as opts}]\n (let [{:keys [tyre oil]} opts]\n (map->F1Car {:team f1-team\n :engine f1-engine\n :tyre f1-tyre\n :oil f1-oil})))\n\n;;create a record\n(def mclaren (make-f1team \"RedBull\" \"Renault\" {:f1-tyre\"Pirelli\" :f1-oil \"Castrol\"}))\n\n;;retrieve values\n(keys mclaren)\n(vals mclaren)\n(:team mclaren)\n(:oil mclaren)"
";;It is possible to enumerate the symbols created within a let using a macro.\n(defmacro local-context []\n (let [symbols (keys &env)]\n (zipmap (map (fn [sym] `(quote ~sym)) symbols) symbols)))\n\n(let [a :b lc (local-context)] lc)\n;; => {a :b}"
";; the destructuring key, k in this example, doesn't have to be a literal keyword\n(let [k (keyword \"name\")\n {person-name k} {:name \"john\"}]\n person-name)\n;; => \"john\""
";; There is some confusion in various lisps about the scope of variables in the\n;; bindings of let variables. It works as follows in Clojure.\n(let [y 'OUTER]\n (let [y 'INNER\n x y] ;; binds x to 'INNER, not to 'OUTER\n x))\n;; => inner\n\n;; Note that both Common Lisp and emacs lisp would bind x to 'OUTER not 'INNER\n;; in the corresponding code.\n"],
";; There is some confusion in various lisps about the scope of variables in the\n;; bindings of let variables. It works as follows in Clojure.\n(let [y 'OUTER]\n (let [y 'INNER\n x y] ;; binds x to 'INNER, not to 'OUTER\n x))\n;; => inner\n\n;; Note that both Common Lisp and emacs lisp would bind x to 'OUTER not 'INNER\n;; in the corresponding code.\n\n;; But this is because `let` in Common Lisp and emacs lisp does not bind sequentially.\n;; The correct analogue of Clojure's `let` is in fact `let*` in these other lisps,\n;; in which case the behaviour does match."],
:macro true,
:notes
["Nota Bene: `let` in Clojure is like `let*` in Scheme -- each init-expr has access to the preceding binding forms. (There is also a `let*`, but it is more or less `let` without destructuring, and in fact is the underlying implementation.)"
Expand Down
2 changes: 1 addition & 1 deletion exports/export.compact.min.edn

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion exports/export.edn

Large diffs are not rendered by default.

0 comments on commit 03ee3c0

Please sign in to comment.