profile
viewpoint
Lee Read lread Ottawa, Ontario, Canada

lread/clj-graal-docs 163

Scripts and tips to get Clojure latest working with GraalVM latest

clj-commons/rewrite-cljs 37

Traverse and rewrite Clojure/ClojureScript/EDN from ClojureScript

cljdoc/cljdoc-analyzer 2

Get resolved metadata from Clojure and ClojureScript projects

lread/lee-clojure-journey 1

Lee's Clojure Journey ~ a winding course of happy distractions

cljdoc/cljdoc-exerciser 0

A dummy project to test cljdoc formatting and features

lread/babashka 0

A Clojure babushka for the grey areas of Bash (native fast-starting Clojure scripting environment)

lread/cli-matic 0

Compact, hands-free [sub]command line parsing library for Clojure.

lread/clj-duckling 0

Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings. (a duckling clojure fork)

lread/clj-kondo 0

A linter for Clojure code that sparks joy.

lread/clj-reflector-graal-java11-fix 0

A fix for an issue with clojure.lang.Reflector in GraalVM native-image JDK11.

PublicEvent

push eventlread/sci-test

lread

commit sha 345e904ccff060e6aad7d630e0002a6f1a707947

Unfinished refactor fix

view details

push time in a day

push eventlread/sci-test

lread

commit sha 5b2182397c5ce36344247e9e8231878d4fd58ada

Correct ns requires

view details

push time in a day

create barnchlread/sci

branch : lread-line-meta

created branch time in 3 days

pull request commentborkdude/sci

Incorporate Slack discussions with borkdude into README

My best shot at distilling our discussions on Slack without getting too wordy. Lemme know if you want any changes.

lread

comment created time in 8 days

PR opened borkdude/sci

Incorporate Slack discussions with borkdude into README
  • Under "Usage" section, the reader is introduced to bindings. The println binding example might be interpreted as how one should use println with sci. Now mentioning that this simply an illustrative example.
  • Under "Vars" section, add a few of borkdude's Slack chat words on rationale for vars.
  • Under "Stdout and stdin" section, added an example of how an included Clojure function could map to sci's out.
  • Add a "Positional metadata" section - this confused me when I was experimenting with rewrite-cljc under sci.
+38 -5

0 comment

1 changed file

pr created time in 8 days

create barnchlread/sci

branch : lread-readme-tweaks

created branch time in 8 days

push eventlread/sci

Lee Read

commit sha 8c260ef28bdec3fd8158c29487b54337ea0f1bb5

Add sci logo and icon (#137) * Add sci logo and icon Closes #129, see issue for the path that led us to this version. Svg created, then exported to png, with Inkscape on linux. Because the logo width and height are equal, there was no need for a separate icon.svg file. Both logo and icon are exported from logo.svg. * Try moving title below status and de-emphasizing it.

view details

Michiel Borkent

commit sha ee037ef365d0933c0a46076ed79894c6bb49daac

Fix stack (#138)

view details

Michiel Borkent

commit sha 9b70708c5c42e89d94a72aa961bfa1d3a6ef8be4

[#139] add doall and dorun

view details

Michiel Borkent

commit sha 4546b4ab1db7d4af6326fe8c09eaac900bae6b9b

[#140] fix for

view details

Michiel Borkent

commit sha 83ab5b343b680361c8bd07bf332ae6fbafeaf319

bump npm version

view details

Michiel Borkent

commit sha 28858112e4429572f9322ed5e499dd6e40249b67

Update README.md

view details

Michiel Borkent

commit sha c8c89a63aa490106dffc3d4c856d44ba52a83e8d

Update README.md

view details

Michiel Borkent

commit sha 3c6744e8427132c9ed87d96967af4f44c07a4fad

Update README.md

view details

Michiel Borkent

commit sha 2d99ae6f10bffa38c2f0fb03a2e43fdc8e58ec7e

Update README.md

view details

Michiel Borkent

commit sha d081b0e8325dbec1385984bb51d4d880f1923362

Update README.md

view details

Michiel Borkent

commit sha d067faf89b8cfbe8b695a0a5cfd83a6df677a049

Update README.md

view details

Michiel Borkent

commit sha 89ca3ff6ab0a4cca68f05e695d8e22e4a56a5e86

Update README.md

view details

Michiel Borkent

commit sha cf8db779576d85c745d4d43e1df54582ea8b6484

[#141] fix for/doseq in combination with :termination-safe

view details

Michiel Borkent

commit sha a66dd0dce8edab65627b86f6388100740e36bd66

Update SCI_VERSION

view details

Michiel Borkent

commit sha 320ba4e23b57802de5a20400c63f4ceeec86a30c

[#143] fix macro named binding

view details

Michiel Borkent

commit sha c23dc0e15fb28247e90a9bc01f1516e788558fba

[#145] better error messages for def/defn/fn syntax

view details

Michiel Borkent

commit sha 09519a4639250dd9d0a29ca8e9199e1e1046d398

Update SCI_VERSION

view details

Michiel Borkent

commit sha 163f947589f22f3e6e6803e1e33c827d89209640

Add support for method calls

view details

Michiel Borkent

commit sha cb1dc3139a53c680b2bdc1038d2c6e26b975ee8e

Interop support

view details

Michiel Borkent

commit sha ab5ba82fa61ab47b7ace8b3e58bfa633ae8e1f72

fix static access

view details

push time in 8 days

issue openedborkdude/sci

metadata fn on defn f fails if calling defn f

version 0.1.1-alpha.2

platform macOS 10.15.5 Clojure 1.10.536 on JDK 11

symptom When metadata :test on (defn x) is a function and that function calls x, x cannot be resolved.

This use case occurs in test.check's defspec.

repro Here's my attempt at distilling the issue to a file we'll call metaeval.clj:

(defn ^{:test (fn []
                (println "hey there from af meta fn")
                (af))}
  af []
   (println "hi from af"))

(println "call af:")
(af)

(println "\ncall af :test fn:")
((:test (meta #'af)))

expected behavior If we run the above code through Clojure, all works as expected:

> clojure metaeval.clj
call af:
hi from af

call af :test fn:
hey there from af meta fn
hi from af

actual behaviour Running the same code through sci gives us:

> clojure -Sdeps '{:deps {borkdude/sci {:mvn/version "0.1.1-alpha.2"}}}' \
               --report stderr \
               -e "(require '[sci.core :as sci]) (sci/binding [sci/out *out*] (sci/eval-string (slurp \"metaeval.clj\")))"
{:clojure.main/message
 "Execution error (ExceptionInfo) at sci.impl.utils/throw-error-with-location (utils.cljc:54).\nCould not resolve symbol: af [at line 3, column 18]\n",
 :clojure.main/triage
 {:clojure.error/class clojure.lang.ExceptionInfo,
  :clojure.error/line 54,
  :clojure.error/cause
  "Could not resolve symbol: af [at line 3, column 18]",
  :clojure.error/symbol sci.impl.utils/throw-error-with-location,
  :clojure.error/source "utils.cljc",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.ExceptionInfo,
    :message "Could not resolve symbol: af [at line 3, column 18]",
    :data {:type :sci/error, :line 3, :column 18},
    :at
    [sci.impl.utils$throw_error_with_location
     invokeStatic
     "utils.cljc"
     54]}],
  :trace
  [[sci.impl.utils$throw_error_with_location
    invokeStatic
    "utils.cljc"
    54]
   [sci.impl.utils$throw_error_with_location invoke "utils.cljc" 44]
   [sci.impl.utils$throw_error_with_location
    invokeStatic
    "utils.cljc"
    45]
   [sci.impl.utils$throw_error_with_location invoke "utils.cljc" 44]
   [sci.impl.analyzer$resolve_symbol invokeStatic "analyzer.cljc" 137]
   [sci.impl.analyzer$resolve_symbol invoke "analyzer.cljc" 115]
   [sci.impl.analyzer$analyze_call invokeStatic "analyzer.cljc" 645]
   [sci.impl.analyzer$analyze_call invoke "analyzer.cljc" 637]
   [sci.impl.analyzer$analyze invokeStatic "analyzer.cljc" 748]
   [sci.impl.analyzer$analyze invoke "analyzer.cljc" 727]
   [sci.impl.analyzer$analyze_children$fn__905
    invoke
    "analyzer.cljc"
    146]
   [clojure.core$mapv$fn__8445 invoke "core.clj" 6912]
   [clojure.lang.PersistentList reduce "PersistentList.java" 144]
   [clojure.core$reduce invokeStatic "core.clj" 6827]
   [clojure.core$mapv invokeStatic "core.clj" 6903]
   [clojure.core$mapv invoke "core.clj" 6903]
   [sci.impl.analyzer$analyze_children
    invokeStatic
    "analyzer.cljc"
    146]
   [sci.impl.analyzer$analyze_children invoke "analyzer.cljc" 145]
   [sci.impl.analyzer$expand_fn_args_PLUS_body
    invokeStatic
    "analyzer.cljc"
    198]
   [sci.impl.analyzer$expand_fn_args_PLUS_body
    invoke
    "analyzer.cljc"
    166]
   [sci.impl.analyzer$expand_fn$fn__933 invoke "analyzer.cljc" 222]
   [clojure.lang.PersistentVector reduce "PersistentVector.java" 343]
   [clojure.core$reduce invokeStatic "core.clj" 6827]
   [clojure.core$reduce invoke "core.clj" 6810]
   [sci.impl.analyzer$expand_fn invokeStatic "analyzer.cljc" 219]
   [sci.impl.analyzer$expand_fn invoke "analyzer.cljc" 205]
   [sci.impl.analyzer$analyze_call invokeStatic "analyzer.cljc" 670]
   [sci.impl.analyzer$analyze_call invoke "analyzer.cljc" 637]
   [sci.impl.analyzer$analyze invokeStatic "analyzer.cljc" 748]
   [sci.impl.analyzer$analyze invoke "analyzer.cljc" 727]
   [sci.impl.analyzer$analyze_children$fn__905
    invoke
    "analyzer.cljc"
    146]
   [clojure.core$mapv$fn__8445 invoke "core.clj" 6912]
   [clojure.core.protocols$iter_reduce invokeStatic "protocols.clj" 49]
   [clojure.core.protocols$fn__8148 invokeStatic "protocols.clj" 75]
   [clojure.core.protocols$fn__8148 invoke "protocols.clj" 75]
   [clojure.core.protocols$fn__8088$G__8083__8101
    invoke
    "protocols.clj"
    13]
   [clojure.core$reduce invokeStatic "core.clj" 6828]
   [clojure.core$mapv invokeStatic "core.clj" 6903]
   [clojure.core$mapv invoke "core.clj" 6903]
   [sci.impl.analyzer$analyze_children
    invokeStatic
    "analyzer.cljc"
    146]
   [sci.impl.analyzer$analyze_children invoke "analyzer.cljc" 145]
   [sci.impl.analyzer$analyze invokeStatic "analyzer.cljc" 742]
   [sci.impl.analyzer$analyze invoke "analyzer.cljc" 727]
   [sci.impl.analyzer$expand_declare$fn__1037$fn__1038$fn__1039
    invoke
    "analyzer.cljc"
    477]
   [clojure.lang.ArrayChunk reduce "ArrayChunk.java" 58]
   [clojure.core.protocols$fn__8154 invokeStatic "protocols.clj" 136]
   [clojure.core.protocols$fn__8154 invoke "protocols.clj" 124]
   [clojure.core.protocols$fn__8114$G__8109__8123
    invoke
    "protocols.clj"
    19]
   [clojure.core.protocols$seq_reduce invokeStatic "protocols.clj" 31]
   [clojure.core.protocols$fn__8144 invokeStatic "protocols.clj" 75]
   [clojure.core.protocols$fn__8144 invoke "protocols.clj" 75]
   [clojure.core.protocols$fn__8088$G__8083__8101
    invoke
    "protocols.clj"
    13]
   [clojure.core$reduce invokeStatic "core.clj" 6828]
   [clojure.core$reduce invoke "core.clj" 6810]
   [sci.impl.analyzer$expand_declare$fn__1037$fn__1038
    invoke
    "analyzer.cljc"
    469]
   [clojure.lang.AFn applyToHelper "AFn.java" 154]
   [clojure.lang.AFn applyTo "AFn.java" 144]
   [clojure.core$apply invokeStatic "core.clj" 667]
   [clojure.core$update_in$up__6853 invoke "core.clj" 6185]
   [clojure.core$update_in$up__6853 invoke "core.clj" 6184]
   [clojure.core$update_in invokeStatic "core.clj" 6186]
   [clojure.core$update_in doInvoke "core.clj" 6172]
   [clojure.lang.RestFn invoke "RestFn.java" 445]
   [sci.impl.analyzer$expand_declare$fn__1037
    invoke
    "analyzer.cljc"
    467]
   [clojure.lang.Atom swap "Atom.java" 37]
   [clojure.core$swap_BANG_ invokeStatic "core.clj" 2352]
   [clojure.core$swap_BANG_ invoke "core.clj" 2345]
   [sci.impl.analyzer$expand_declare invokeStatic "analyzer.cljc" 464]
   [sci.impl.analyzer$expand_declare invoke "analyzer.cljc" 463]
   [sci.impl.analyzer$expand_defn invokeStatic "analyzer.cljc" 324]
   [sci.impl.analyzer$expand_defn invoke "analyzer.cljc" 321]
   [sci.impl.analyzer$analyze_call invokeStatic "analyzer.cljc" 673]
   [sci.impl.analyzer$analyze_call invoke "analyzer.cljc" 637]
   [sci.impl.analyzer$analyze invokeStatic "analyzer.cljc" 748]
   [sci.impl.analyzer$analyze invoke "analyzer.cljc" 727]
   [sci.impl.interpreter$eval_form invokeStatic "interpreter.cljc" 647]
   [sci.impl.interpreter$eval_form invoke "interpreter.cljc" 639]
   [sci.impl.interpreter$eval_string_STAR_
    invokeStatic
    "interpreter.cljc"
    659]
   [sci.impl.interpreter$eval_string_STAR_
    invoke
    "interpreter.cljc"
    653]
   [sci.impl.interpreter$eval_string
    invokeStatic
    "interpreter.cljc"
    668]
   [sci.impl.interpreter$eval_string invoke "interpreter.cljc" 664]
   [sci.core$eval_string invokeStatic "core.cljc" 179]
   [sci.core$eval_string invoke "core.cljc" 142]
   [sci.core$eval_string invokeStatic "core.cljc" 177]
   [sci.core$eval_string invoke "core.cljc" 142]
   [user$eval5158 invokeStatic "NO_SOURCE_FILE" 1]
   [user$eval5158 invoke "NO_SOURCE_FILE" 1]
   [clojure.lang.Compiler eval "Compiler.java" 7177]
   [clojure.lang.Compiler eval "Compiler.java" 7132]
   [clojure.core$eval invokeStatic "core.clj" 3214]
   [clojure.main$eval_opt invokeStatic "main.clj" 488]
   [clojure.main$eval_opt invoke "main.clj" 482]
   [clojure.main$initialize invokeStatic "main.clj" 508]
   [clojure.main$null_opt invokeStatic "main.clj" 542]
   [clojure.main$null_opt invoke "main.clj" 539]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause "Could not resolve symbol: af [at line 3, column 18]",
  :data {:type :sci/error, :line 3, :column 18}}}

Execution error (ExceptionInfo) at sci.impl.utils/throw-error-with-location (utils.cljc:54).
Could not resolve symbol: af [at line 3, column 18]

Notice that af could not be resolved within the meta :test function.

created time in 10 days

issue openedborkdude/sci

Metadata on defn is not evaluated

version recent pull from master, illustrations below are via bb v0.1.3

platform macOS 10.15.5 Clojure 1.10.536 on JDK 11 for Clojure examples

symptom While bringing in portions of test.check for an experimental project, I noticed that defspec was failing.

repro While trying to diagnose why defspec was failing noticed that the defspec macro is slightly different from clojure.test’s deftest in the way it attaches metadata.

defspec attaches metadata to a defn whereas deftest attaches metadata it to a def.

Here’s my attempt at distilling the difference to a snippit in a file we'll call metadefn.clj:

(require '[clojure.pprint :as pprint])

(println "metadata fn on def")
(def ^{:test (fn [] (println "hey there from a"))} a 1)
(pprint/pprint (meta #'a))
((:test (meta #'a)))

(println "\nmetadata fn on defn")
(defn ^{:test (fn [] (println "hey there from af"))} af [])
(pprint/pprint (meta #'af))
((:test (meta #'af)))

expected behavior If we run the above snippit through Clojure, we get:

> clojure metadefn.clj 
metadata fn on def
{:test #object[user$fn__140 0x29f0802c "user$fn__140@29f0802c"],
 :line 4,
 :column 1,
 :file "/Users/lee/proj/oss/play/metadefn.clj",
 :name a,
 :ns #object[clojure.lang.Namespace 0x29a23c3d "user"]}
hey there from a

metadata fn on defn
{:test #object[user$fn__148 0x1a411233 "user$fn__148@1a411233"],
 :arglists ([]),
 :line 9,
 :column 1,
 :file "/Users/lee/proj/oss/play/metadefn.clj",
 :name af,
 :ns #object[clojure.lang.Namespace 0x29a23c3d "user"]}
hey there from af

actual behavior Running the same snippit through sci (via babashka) gives us:

> bb metadefn.clj 
metadata fn on def
{:line 4,
 :column 6,
 :end-line 4,
 :end-column 53,
 :test #object[sci.impl.fns$parse_fn_args_PLUS_body$run_fn__12684
               "0x7473ea2e"
               "sci.impl.fns$parse_fn_args_PLUS_body$run_fn__12684@10f217700"],
 :name a,
 :ns #object[sci.impl.vars.SciNamespace "0x84a3722" "user"],
 :file "/Users/lee/proj/oss/play/metadefn.clj"}
hey there from a

metadata fn on defn
{:ns #object[sci.impl.vars.SciNamespace "0x84a3722" "user"],
 :name af,
 :file "/Users/lee/proj/oss/play/metadefn.clj",
 :end-column 60,
 :column 1,
 :line 9,
 :end-line 9,
 :arglists ([]),
 :test (fn [] (println "hey there from af"))}
java.lang.Exception: Cannot call (fn [] (println "hey there from af")) as a function. [at /Users/lee/proj/oss/play/metadefn.clj, line 11, column 1]

Notice for that the defn :test metadata was not evaluated whereas the def version was.

created time in 11 days

pull request commentborkdude/clj-reflector-graal-java11-fix

Add tools deps usage notes to README

Ya, good idea, done.

lread

comment created time in 12 days

push eventlread/clj-reflector-graal-java11-fix

Lee Read

commit sha 97f48f7fcb602608e19c304cfd89a451018b73ba

Refine README Usage Section Add in rationale for native dep exclusion for tools deps. With this extra text, for clarity, reorganized usage into subsections.

view details

push time in 12 days

PR opened borkdude/clj-reflector-graal-java11-fix

Add tools deps usage notes to README

This project depends on native dep org.graalvm.nativeimage/svm.

While technically correct, tools deps does not support native deps and fails for this native dep.

Since the native dep is provided by the Graal installation anyway, it can be safely excluded for tools deps.

+16 -1

0 comment

1 changed file

pr created time in 12 days

push eventlread/clj-reflector-graal-java11-fix

Lee Read

commit sha ef0274a3669a8076c6d749be2142554ea667e2ea

Add tools deps usage notes to README This project depends on native dep org.graalvm.nativeimage/svm. While technically correct, tools deps does not support native deps and fails for this native dep. Since the native dep is provided by the Graal installation anyway, it can be safely excluded for tools deps.

view details

push time in 12 days

fork lread/clj-reflector-graal-java11-fix

A fix for an issue with clojure.lang.Reflector in GraalVM native-image JDK11.

fork in 12 days

push eventlread/rewrite-cljc-playground

lread

commit sha 0d38998bc902ddcc034e9000c451c6eb900483e3

Paredit tests now using rewrite-cljc.zip * fns Paredit tests, maybe because they came from rewrite-cljs, were using clojure.zip ns directly. Switched to using rewrite-cljc.zip * equivalents instead.

view details

push time in 14 days

push eventlread/rewrite-cljc-playground

lread

commit sha e4c3b2d4921d54c95a9463e0a23298b278514b01

Now coercing array maps when running under ClojureScript Beefed up map tests. Retained fact that we always `sepxr` to `hash-map` regardless of map size or source type. Added support for array-map for ClojureScript. Formerly when running under cljs could not coerce from `{:a 1 :b 2}` nor `(array-map :a 1 :b 2)` created maps. Closes #40

view details

push time in 14 days

issue closedlread/rewrite-cljc-playground

Map conversion under ClojureScript does not handle array maps

While beefing up tests for #37, noticed only (hash-map) created maps are coercing on ClojureScript.

closed time in 14 days

lread

issue openedlread/rewrite-cljc-playground

Map conversion under ClojureScript does not handle array maps

While beefing up tests for #37, noticed only (hash-map) created maps are coercing on ClojureScript.

created time in 14 days

push eventlread/rewrite-cljc-playground

lread

commit sha fa8d89567391d90dd9c25d469170d51817a6efb7

Refactor test for readability

view details

lread

commit sha 580bde895016baddad9d361d39336a72aa4fba3f

Upgrade figwheel main to current version

view details

lread

commit sha f991b7ec7bd3e007e015832ec9558df5d0e5fe38

Clarify and correct coercion Be more explicit around existing coercion tests and expound on metadata Clojure adds to quoted lists. The more explicit testing uncovered issues with empty list and hashmap coercion for ClojureScript, now fixed. Closes #37, #38, #39

view details

push time in 14 days

issue closedlread/rewrite-cljc-playground

Coercing a list includes non-obvious metadata

Clojure

Rewrite-clj (and therefore rewrite-cljc) supports coercion of Clojure to rewrite-cljc nodes.

For example (rewrite-cljc.zip/replace zloc [1 2 3]) automatically coerces [1 2 3] to a rewrite-cljc vector node.

This is all very handy but Clojure adds, what seems to me, non-obvious metadata to lists.

Clojure 1.10.1
user=> ;; a quoted list has :line and :column metadata
user=> (meta '(1 2 3))
{:line 1, :column 8}

user=> ;; apparently forcefully so!
user=> (meta ^:hi '(1 2 3))
{:line 1, :column 13}

user=> ;; but things are different if we do not quote
user=> (meta (list 1 2 3))
nil

user=> ;; but they are still, to me, odd - why is there no metadata on this list?
user=> (meta ^:hi (list 1 2 3))
nil

user=> ;; compare this with vectors which work as one might expect
user=> (meta ^:hi [1 2 3])
{:hi true}
user=> (meta [1 2 3])
nil

The problem with this Clojure provided metadata is that it is included in coercion.
A '(list 1 2 3) will be coerced into a :meta rewrite-clj node.

Because we cannot know what the source of the metadata is, we cannot strip it. I suppose all we can do is clarify the behaviour with some tests and add some guidance to rewrite-cljc docs.

ClojureScript

ClojureScript is less interesting in this area.

ClojureScript 1.10.758
user=> ;; cljs seems to consistently return nil for parsed lists (even when metadata is specified)
cljs.user=> (meta '(1 2 3))
nil
cljs.user=> (meta ^:hi '(1 2 3))
nil
cljs.user=> (meta (list 1 2 3))
nil
cljs.user=> (meta ^:hi (list 1 2 3))
nil

user=> ;; cljs vector behaviour is more what I would expect
cljs.user=> (meta ^:hi [1 2 3])
{:hi true}

closed time in 14 days

lread

issue openedlread/rewrite-cljc-playground

ClojureScript empty list coerces to :token tag

While cleaning up tests in response to #37, I noticed that a ClojureScript empty list is coercing to a :token tag node.

created time in 14 days

issue openedlread/rewrite-cljc-playground

ClojureScript hashmap coerces to :unknown

While cleaning up coercion tests for #37, I noticed that in ClojureScript a hashmap was converting to an :unkown node tag.

created time in 14 days

issue openedlread/rewrite-cljc-playground

Coercing a list includes non-obvious metadata

Clojure

Rewrite-clj (and therefore rewrite-cljc) supports coercion of Clojure to rewrite-cljc nodes.

For example (rewrite-cljc.zip/replace zloc [1 2 3]) automatically coerces [1 2 3] to a rewrite-cljc vector node.

This is all very handy but Clojure adds, what seems to me, non-obvious metadata to lists.

Clojure 1.10.1
user=> ;; a quoted list has :line and :column metadata
user=> (meta '(1 2 3))
{:line 1, :column 8}

user=> ;; apparently forcefully so!
user=> (meta ^:hi '(1 2 3))
{:line 1, :column 13}

user=> ;; but things are different if we do not quote
user=> (meta (list 1 2 3))
nil

user=> ;; but they are still, to me, odd - why is there no metadata on this list?
user=> (meta ^:hi (list 1 2 3))
nil

user=> ;; compare this with vectors which work as one might expect
user=> (meta ^:hi [1 2 3])
{:hi true}
user=> (meta [1 2 3])
nil

The problem with this Clojure provided metadata is that it is included in coercion.
A '(list 1 2 3) will be coerced into a :meta rewrite-clj node.

Because we cannot know what the source of the metadata is, we cannot strip it. I suppose all we can do is clarify the behaviour with some tests and add some guidance to rewrite-cljc docs.

ClojureScript

ClojureScript is less interesting in this area.

ClojureScript 1.10.758
user=> ;; cljs seems to consistently return nil for parsed lists (even when metadata is specified)
cljs.user=> (meta '(1 2 3))
nil
cljs.user=> (meta ^:hi '(1 2 3))
nil
cljs.user=> (meta (list 1 2 3))
nil
cljs.user=> (meta ^:hi (list 1 2 3))
nil

user=> ;; cljs vector behaviour is more what I would expect
cljs.user=> (meta ^:hi [1 2 3])
{:hi true}

created time in 15 days

push eventlread/rewrite-cljc-playground

lread

commit sha f94c5fd5601d363fc5f39eb77aea649aa80a2abb

Review and update Graal native-image testing options

view details

push time in 15 days

push eventlread/rewrite-cljc-playground

lread

commit sha d2f799babcf1c6b66d7e3ee3a6492d3d7c4d708f

Outline current known Graal native-image options in design doc

view details

push time in 16 days

issue commentlread/rewrite-cljc-playground

GraalVM support

rewrite-cljc tests employ test.check which, I suppose, would also have to be added to babashka.

lread

comment created time in 17 days

fork lread/babashka

A Clojure babushka for the grey areas of Bash (native fast-starting Clojure scripting environment)

fork in 17 days

issue commentlread/rewrite-cljc-playground

Verify against atomist/update-leiningen-dependencies

After addressing issue with Shadow CLJS in rewrite-cljc, success! https://github.com/lread/update-leiningen-dependencies-skill/commit/405d1783afed47d730712bbf93213d29af2ab897

lread

comment created time in 17 days

issue closedlread/rewrite-cljc-playground

Verify against atomist/update-leiningen-dependencies

slimslenderslacks on Slack pinged with with a rewrite-cljs project to verify against: https://github.com/atomist-skills/update-leiningen-dependencies-skill

Some notes from slim:

There's a shadow-cljs :node-test target in https://github.com/atomist-skills/update-leiningen-dependencies-skill that you can probably run with npm ci && npm run test

And:

This was actually my first shadow-cljs :node-target but it is running a test that exercises rewrite-cljs so could be useful.

This will be the first pure cljs only project I verify, so exciting!

closed time in 17 days

lread

push eventlread/repro-shadow-cljs-analyzer-macro-diff

lread

commit sha d55ba0f18a8cab9317fe22fb845dae34b92f244b

Docs: Syntax for code markdown code block fixed

view details

push time in 17 days

push eventlread/repro-shadow-cljs-analyzer-macro-diff

lread

commit sha e6680ba189f8427aa71d73bdc78aabf96556b119

Look at differences when resolving macro symbols

view details

push time in 17 days

push eventlread/rewrite-cljc-playground

lread

commit sha 4c22974df4b0cde77a92e0eede4488be28da5e33

Adapt cljs import-vars for Shadow CLJS Adapt to fact that Shadow CLJS returns different data than ClojureScript when resolving macros. Now also running tests under Shadow CLJS.

view details

push time in 17 days

push eventlread/repro-shadow-cljs-analyzer-macro-diff

lread

commit sha ce35527709bd1982cbc8db41d6b7a07ef94537b0

Stop building on CircleCI It was not rendering ANSI colors properly and therefore misleading. Include a screenshot instead.

view details

push time in 18 days

push eventlread/repro-shadow-cljs-analyzer-macro-diff

lread

commit sha d2698b9a6a02ff9731ea8ed1f18bc2f462e473d8

Fix circleci config

view details

push time in 18 days

create barnchlread/repro-shadow-cljs-analyzer-macro-diff

branch : master

created branch time in 18 days

created repositorylread/repro-shadow-cljs-analyzer-macro-diff

Reproduction of difference between CloureScript and Shadown CLJS macro in compiler analyzer data

created time in 18 days

push eventlread/rewrite-cljc-playground

lread

commit sha 784d59f6b72275e724a2259a59affe187da5b741

Upgrade npm deps used for cljs testing

view details

push time in 19 days

push eventlread/rewrite-cljc-playground

lread

commit sha e70d0c5d7f2f9c071972b9337beb17da11b0dc56

Update contributor images Also update commons-io dep which is only used by update-readme

view details

push time in 19 days

push eventlread/rewrite-cljc-playground

lread

commit sha 677ecb57f4429921ef2c94bb5c9dcda61aa5d138

Upgrade to kaocha to current release

view details

push time in 19 days

push eventlread/rewrite-cljc-playground

lread

commit sha 2c317f407eab4112be439e06a53c14a242a7ee22

Upgrade to current ClojureScript

view details

push time in 19 days

pull request commentborkdude/clj-kondo

Update hooks docs

Writing docs is hard! Lemme know what you think of my changes.

lread

comment created time in 19 days

PR opened borkdude/clj-kondo

Update hooks docs

Current docs are good and guided me when writing my first hook. Hooks aren't scary hard to write, nor are they easy peasy. Here are some changes to hooks docs that I think might help a bit:

  • Let folks know hooks are interpreted with sci
  • Introduce the concept of rewrite-clj nodes early so that subsequent references to nodes have context
  • Give the reason why someone might want to write an analyze-call hook earlier
  • Try to focus on more on the code than its representation as a node
  • Give a couple of examples of what Clojure code looks like when parsed into a rewrite-clj node
  • Other minor changes and, hopefully welcome, tweaks.
+58 -23

0 comment

1 changed file

pr created time in 19 days

create barnchlread/clj-kondo

branch : lread-hooks-docs

created branch time in 19 days

issue commentborkdude/babashka

add clojure.java.browse/browse-url

A note from lukasz on Slack:

@lread FWIW - open and xdg-open do all of this for you in OSX and Linux respectively, so could be just a one-liner. No idea about Windows

borkdude

comment created time in 21 days

push eventlread/rewrite-cljc-playground

lread

commit sha 09882e1244a8c12879ef8c1e6872724748e7914b

Add linting for import-vars-with-mods macro clj-kondo now allows us to use hooks to optionally communicate the effect of any macro it does not already understand.

view details

push time in 21 days

created taglread/docker-gitweb-quick

tagv1.0.15

A quick way to expose your git repo locally to your web browser for testing

created time in 22 days

push eventlread/docker-gitweb-quick

lread

commit sha e5cad59e3cc0dfbeedd2b878cf1b18470666b722

Adapt to the way CircleCI works with docker mounts When running CircleCI from a docker image, ya just can't mount a volume from another docker image. Adapted by starting other docker image, doing a docker cp, then stopping image.

view details

push time in 22 days

push eventlread/docker-gitweb-quick

lread

commit sha 6f7f5797fbe25391c88b0c265cfc443a2e50c0fd

Attempt at mounted volume from docker container Wild stab: try adding :rw option on mounted docker volume. I'm running in docker on CircleCI and trying to mount a volume in another docker container. And maybe this simply does not work.

view details

push time in 23 days

push eventlread/docker-gitweb-quick

lread

commit sha 5b94c1fca389f629d93d6a6eb8889f6d2c06bc04

Makefile fix - target directory for stylesheet now pre-created properly - formatting of status message for test corrected

view details

push time in 23 days

push eventlread/docker-gitweb-quick

lread

commit sha 5e5cba6bd7d51a9419d87d450383cdc7fd0aa8a5

Improve syntax highlighting Transcribe highlight app filename and file extension syntax highlighting config to gitweb config. Freshen gitweb highlight css with current highlight app css. Because Clojure is used within above, we switch to a CircleCI clojure image. Also, tweaks to Makefile to improve status reporting.

view details

push time in 23 days

issue openedlread/rewrite-cljc-playground

Verify against atomist/update-leiningen-dependencies

slimslenderslacks on Slack pinged with with a rewrite-cljs project to verify against: https://github.com/atomist-skills/update-leiningen-dependencies-skill

Some notes from slim:

There's a shadow-cljs :node-test target in https://github.com/atomist-skills/update-leiningen-dependencies-skill that you can probably run with npm ci && npm run test

And:

This was actually my first shadow-cljs :node-target but it is running a test that exercises rewrite-cljs so could be useful.

This will be the first pure cljs only project I verify, so exciting!

created time in 23 days

startedathos/pogonos

started time in 24 days

created taglread/docker-gitweb-quick

tagv1.0.11

A quick way to expose your git repo locally to your web browser for testing

created time in 24 days

push eventlread/docker-gitweb-quick

lread

commit sha 5fab179cfd9299b83fbf11f7c0ab4ea72fc41914

Update circleci config to use github repo write privs

view details

push time in 24 days

push eventlread/docker-gitweb-quick

lread

commit sha 5cad925b86518592ac8842164cc6176b845d080c

CircleCI config Ok can't use docker_layer_caching but still need to specify setup_remote_docker

view details

push time in 24 days

push eventlread/docker-gitweb-quick

lread

commit sha 3b07f087e6b639eaa501b54826a94d514114fb5b

CircleCI config Can't use layer caching in free tier

view details

push time in 24 days

push eventlread/docker-gitweb-quick

lread

commit sha 8f7e042bc0ded1d1b0ffe511226d0d3b43d12c9e

CircleCI config

view details

push time in 24 days

push eventlread/docker-gitweb-quick

lread

commit sha e7225cccd9944ac3ee80163ad9fcc87679e5d8da

CircleCI config

view details

push time in 24 days

push eventlread/docker-gitweb-quick

lread

commit sha 70741508f35d5a65c5e7a6f02a4a8999ae6945da

Fix typo in comment

view details

lread

commit sha 6c60442314f06ea2f44a0cf425e2ffa0f4f66243

Add release support The idea is that on each push to master, circleci will be triggered to build, push a git version tag, and push image to docker.

view details

push time in 24 days

created taglread/docker-gitweb-quick

tagv1.0.5

A quick way to expose your git repo locally to your web browser for testing

created time in 24 days

create barnchlread/docker-gitweb-quick

branch : master

created branch time in 24 days

created repositorylread/docker-gitweb-quick

A quick way to expose your git repo locally to your web browser for testing

created time in 24 days

issue closedlread/rewrite-cljc-playground

Verify rewrite-cljc against refactor-nrepl

Let's see what we can learn by upgrading https://github.com/clojure-emacs/refactor-nrepl to rewrite-cljc

closed time in a month

lread

issue commentlread/rewrite-cljc-playground

Verify rewrite-cljc against refactor-nrepl

Success: https://github.com/lread/refactor-nrepl/commits/lread-rewrite-cljc-test

lread

comment created time in a month

push eventlread/refactor-nrepl

lread

commit sha 4bcf458c5a38c710e721d2624626dd7388665946

rewrite-cljc bonus test: try rewrite-cljc version of lein-cljfmt Build script tests via `make cljfmt`, so I'll do the same. 1) Verify no errors on master 2) Try on lread-rewrite-clj-test branch - see 2 errors. 3) Reconcile difference Notice that project is using 0.6.4 of lein-cljfmt, go back to master and upgrade to current version 0.6.7. Output now matches that of lread-rewrite-clj-test branch.

view details

push time in a month

push eventlread/refactor-nrepl

lread

commit sha 05466bf747ad69a5798bcb2bb284b7e95281289c

rewrite-cljc bonus test: try rewrite-cljc version of lein-cljfmt

view details

push time in a month

push eventlread/cljfmt

lread

commit sha c2bfa3cdc03e416a6bf15a714cae086ff5ab13e4

Take a crack at upgrading lein-cljfmt to rewrite-cljc Point lein-cljfmt at our test version of cljfmt that use rewrite-cljc

view details

push time in a month

create barnchlread/refactor-nrepl

branch : lread-rewrite-cljc-test

created branch time in a month

fork lread/refactor-nrepl

nREPL middleware to support refactorings in an editor agnostic way

fork in a month

startedclojure-emacs/refactor-nrepl

started time in a month

issue openedlread/rewrite-cljc-playground

Verify rewrite-cljc against refactor-nrepl

Let's see what we can learn by upgrading https://github.com/clojure-emacs/refactor-nrepl to rewrite-cljc

created time in a month

issue commentlread/rewrite-cljc-playground

GraalVM support

@borkdude shared a strategy with me on Slack that I must try:

  1. build a custom native-image of babashka including rewrite-cljc like other babashka built in libraries
  2. run rewrite-cljc test suite using custom native-image of babashka
lread

comment created time in a month

issue openedlread/rewrite-cljc-playground

Look into summarizing changes to rewrite-clj/rewrite-cljs into separate doc

Idea from chat with @borkdude on Slack:

I have a good description detailing changes from rewrite-clj and rewrite-cljs in my migration design doc, but these details might better serve the community if they were dissected to a separate doc that can be maintained independent of the initial migration.

created time in a month

issue closedlread/rewrite-cljc-playground

Verify clojure-lsp against rewrite-cljc

Let's see what we can learn by upgrading https://github.com/snoe/clojure-lsp to rewrite-cljc

closed time in a month

lread

issue commentlread/rewrite-cljc-playground

Verify clojure-lsp against rewrite-cljc

Success, see commits: https://github.com/lread/clojure-lsp/commits/lread-rewrite-cljc-test

lread

comment created time in a month

push eventlread/clojure-lsp

lread

commit sha 658e9cab297f08aa60bc09707ebdb25b40960ca6

Upgrade to rewrite-cljc test - part 2 This project uses both rewrite-clj and cljfmt which also uses rewrite-clj. I have upgraded to rewrite-cljc and my rewrite-cljc version of cljfmt. Notes of interest - cljfmt does not use deps.edn, so I do a little work under lread-hack to compensate for that. This will no longer be necessary when rewrite-cljc version of cljfmt is up on clojars. - Initial testing found that rewrite-cljc was missing the rewrite-cljc.zip/insert-child* function. Corrected this in rewrite-cljc. - clojure-clj does a little hack into rewrite-clj internals to rewind a consumed zipper: (vary-meta (z/skip z/prev #(z/prev %) loc) assoc ::zm/end? false) This tripped me up a bit at first. Verified via: 1) build rewrite-cljc version of cljfmt cd lread-hack ./build-rewrite-cljc-version-of-cljfmt cd .. 2) compile clojure-lsp Java lein clean lein javac 3) test rewrite-cljc version of clojure-lsp clojure -A:test

view details

push time in a month

create barnchlread/clojure-lsp

branch : lread-rewrite-cljc-test

created branch time in a month

issue openedlread/rewrite-cljc-playground

Verify clojure-lsp against rewrite-cljc

Let's see what we can learn by upgrading https://github.com/snoe/clojure-lsp to rewrite-cljc

created time in a month

push eventlread/rewrite-cljc-playground

lread

commit sha aebb6bb48b1d5b7e1db8392bbfa3d76ffbedca9c

Docs - use clojure-repl for code block

view details

lread

commit sha 4eeac8576341cfd0b205e21745b8ca4063b70476

Provide access insert-child in underlying zipper from Zip API The underlying zipper is used to operate on the zipper without skipping whitespace. We provide access from the Zip API to the underlying zipper functions via their * equivalents. For example zip/next* is the no whitespace skipping equivalent of the whitespace skipping zip/next. The missing zip/insert-child* is now also included.

view details

push time in a month

push eventlread/cljfmt

lread

commit sha 1d8cdff6f3a6ef283cc5fc7f602cd09428641ff0

Upgrade to rewrite-cljc Not on clojars yet, so added rewrite-cljc as dep via lein-git-down. Upgrade was straightforward and consisted of: - renaming namespace references from rewrite-clj to rewrite-cljc - getting rid of rewrite-cljs compatibility workarounds Verified via: cd cljfmt lein test Which tests against Clojure and ClojureScript

view details

push time in a month

fork lread/clojure-lsp

Language Server (LSP) for Clojure

fork in a month

issue openedlread/rewrite-cljc-playground

Address GitHub community recommendations

https://github.com/lread/rewrite-cljc-playground/community

created time in a month

issue closedlread/rewrite-cljc-playground

Verify rewrite-cljc against cljfmt

In a fork/branch, make sure that cljfmt continues to work when it is switched over to rewrite-cljc

closed time in a month

lread

issue closedlread/rewrite-cljc-playground

Verify rewrite-cljc against zprint

In a fork/branch, make sure that zprint continues to work when it is switched over to rewrite-cljc

closed time in a month

lread

issue commentlread/rewrite-cljc-playground

Verify rewrite-cljc against cljfmt

Some good results: https://github.com/lread/cljfmt/commits/lread-rewrite-cljc-test

lread

comment created time in a month

issue commentlread/rewrite-cljc-playground

Verify rewrite-cljc against zprint

Thanks @kkinnear, this has been both fun and educational for me.

It seems that maybe the expectations library can be used with cljs? Or maybe the clojure-test compatible version might be interesting to you? In any case you'd have to rework your tests to be cljc. Let me know if you want a hand with that or with getting your project setup on circleci.

Because rewrite-cljc's tests are passing and and cljfmt's tests (which include cljs) are passing, I'm not too concerned about zprint; zprint cljs tests would be more frosting on the confidence cake, but not having them is ok too.

I'm not sure what to do yet for clojars. This project is slated to be hosted on clj-commons. I'd like to get it over there before the first alpha release to avoid confusing upgrade paths. Even though I have many todos... maybe I am almost ready for an alpha release. I shall keep you posted.

lread

comment created time in a month

delete branch lread/cljfmt

delete branch : lread-rewrite-cljc

delete time in a month

create barnchlread/cljfmt

branch : lread-rewrite-cljc-test

created branch time in a month

push eventlread/cljfmt

James Reeves

commit sha e3053740f20e0eab2aa0dbd9cf664c50a7789d91

Add missing symbol? check Forms that start with a non-symbol were not correctly being filtered out when checking against the indentation files. Fixes #172.

view details

lread

commit sha 431cfdf3f9f4dbab16cd532dce6d4180700e6f2f

Add more guidance to indentation rules docs Closes #182

view details

Bruno Tavares

commit sha 78949b98d003bd4a05cb1091b6c3783f72c784d6

Document usage with deps.tools Since #123 it is now possible to use cljfmt without integrating it with Leiningen. This commit adds documentation to the README on how to achieve that. Closes #93.

view details

r6eve

commit sha 5abe96cde0219d53958837503915cc72475f9963

Fix minor typo in README

view details

Jan Stępień

commit sha 7aa0fed93b1bd1b9708841bf928edba3ed09ac04

Reduce the z/sexpr cost in find-namespace This patch addresses the slowdown introduced between 0.6.4 and 0.6.5 and fixes #181. Prior to this patch, find-namespace and ns-form? called z/sexpr on all traversed forms. The find-namespace logic needed only parts of resulting sexprs. The cost of z/sexpr was non-negligible when invoked on complex forms. As a result, z/sexpr and nested functions dominated the CPU cost of the indentation logic. This patch makes z/sexpr calls more fine-granular and avoids invoking the function on nodes irrelevant to find-namespace. This results in a tenfold speedup.

view details

James Reeves

commit sha 6bd7565a6b0e5eff7de62ef64658d29cd8a34c8d

Release 0.6.7

view details

Ryan McCuaig

commit sha 0d9ea88fd85297285cb3ed4debe36c039a6ab534

Limit default paths in -main to ones that exist Resolves: #192 See also: #148

view details

push time in a month

push eventlread/cljfmt

Bruno Tavares

commit sha e73340d352894b5bdb0affb03a1a403c688c6fb5

Document usage with deps.tools Since #123 it is now possible to use cljfmt without integrating it with Leiningen. This commit adds documentation to the README on how to achieve that. Closes #93.

view details

lread

commit sha 3c6fd08bd9dc8c8abe084009268438486fdef202

Add more guidance to indentation rules docs Closes #182

view details

James Reeves

commit sha 607b44d965eb7bc4329b0da72f83a694179b98c2

Add missing symbol? check Forms that start with a non-symbol were not correctly being filtered out when checking against the indentation files. Fixes #172.

view details

James Reeves

commit sha ae4ecc4941ffb3d551992317e88f37689ad495d5

Merge pull request #183 from lread/lread-indent-docs Add more guidance to indentation rules docs

view details

James Reeves

commit sha bb0aeaea2358899a863a2a1a96f3eb786ac6a243

Merge pull request #164 from bltavares/patch-1 Document usage with deps.tools

view details

r6eve

commit sha 3578b28ac08e34cf0ee08f17ff68cb915c0228c7

Fix minor typo in README

view details

James Reeves

commit sha aba6e62d9c9f1dbd6a8f6e3a56630abb7f7f4627

Merge pull request #184 from r6eve/fix/minor-typo Fix minor typo in README

view details

Jan Stępień

commit sha 8f4bcc2135de8fd2e53f3ea200bb47228c8b22ab

Reduce the z/sexpr cost in find-namespace This patch addresses the slowdown introduced between 0.6.4 and 0.6.5 and fixes #181. Prior to this patch, find-namespace and ns-form? called z/sexpr on all traversed forms. The find-namespace logic needed only parts of resulting sexprs. The cost of z/sexpr was non-negligible when invoked on complex forms. As a result, z/sexpr and nested functions dominated the CPU cost of the indentation logic. This patch makes z/sexpr calls more fine-granular and avoids invoking the function on nodes irrelevant to find-namespace. This results in a tenfold speedup.

view details

James Reeves

commit sha 6924b694a57027b289fac884afab2bda5f83ca07

Merge pull request #188 from jstepien/181 Reduce the z/sexpr cost in find-namespace

view details

James Reeves

commit sha f1380e2df97b85926a16ccfeb1ecd10ae63dc706

Release 0.6.7

view details

Ryan McCuaig

commit sha 52e26c0ea784514bd46989924e5c7455aed900ed

Limit default paths in -main to ones that exist Resolves: #192 See also: #148

view details

James Reeves

commit sha 933fdc718f24559b18540e9a5dcb58d46b5f20d5

Merge pull request #193 from rgm/deps-fix Limit default paths in -main to ones that exist

view details

push time in a month

created taglread/cljfmt

tag0.6.7

A tool for formatting Clojure code

created time in a month

issue commentlread/rewrite-cljc-playground

Verify rewrite-cljc against zprint

Some good results: https://github.com/lread/zprint/commits/lread-rewrite-cljc-test

Noticed a couple of places where zprint was compensating for rewrite-cljs: https://github.com/lread/zprint/blob/49dcf81d3d7f21797136076132d6c031c32c316b/src/zprint/zprint.cljc#L4969-L4971 https://github.com/lread/zprint/blob/49dcf81d3d7f21797136076132d6c031c32c316b/src/zprint/rewrite.cljc#L43-L45 I don't think they are necessary anymore and should be reviewed. There might be other compensations, but those are the ones I saw.

I also would like to run the zprint test suite under cljs but don't know how to do so yet.

lread

comment created time in a month

push eventlread/zprint

lread

commit sha 49dcf81d3d7f21797136076132d6c031c32c316b

Add TODO to review rewrite-cljs compensation hack for :uneval node

view details

push time in a month

push eventlread/zprint

lread

commit sha 127ad8576d068ad42b889f504d8a5738b70d3de7

Use pre-walk from rewrite-cljc Code no longer compensating for lack of pre-walk in rewrite-cljs.

view details

push time in a month

push eventlread/zprint

lread

commit sha 5fb30a8df0846d47851e4761820694853428843e

Upgrade to rewrite-cljc Not on clojars yet, so added rewrite-cljc as dep via lein-git-down. Upgrade was straightforward and consisted of: - renaming namespace references from rewrite-clj to rewrite-cljc - getting rid of rewrite-cljs compatibility workarounds Manual tests all seemed to pass (ran on macOS 10.15.5): lein clean lein uberjar lein with-profile expectations expectations ./test_uberjar ./test_config 1.0.0 uberjar > test_config-uberjar.res cat test_config-uberjar.res ./build.zprintm /Users/lee/.sdkman/candidates/java/20.1.0.r8-grl \ target/zprint-filter-1.0.0 zprintm-1.0.0 ./test_zprintm ./test_config 1.0.0 graalvm-mac > test_config-macos.res diff test_config-uberjar.res test_config-macos.res Untested: - appcds - ClojureScript - did not know how to run tests under cljs - Graal native-image generated linux version, but should be good methinks

view details

push time in a month

create barnchlread/zprint

branch : lread-rewrite-cljc-test

created branch time in a month

issue commentlread/rewrite-cljc-playground

Verify rewrite-cljc against zprint

Hey no problemo, your docs seem very thorough on the usage side, and thanks for the tips.

I noticed you do have some notes on testing.

Before integrating rewrite-cljc, I wanted to see things pass so I did figure out some things.

I've found a way to run zprint tests under Clojure that worked for me:

lein with-profile expectations expectations

I ran your commands above, they seem to pass (?).

If you ^c out of this test, be sure and clean up ~/.zprintrc and ./.zprintrc!
...........  --url
...........  --url, with URL missing, see if cache works
...........  --url, with URL missing, see if expired cache works
...........  --url, with URL missing, and no cache
...........  --url, with URL not a valid Clojure map, and no cache
...........  --url, with URL not a valid zprint options map, and no cache
...........  --url-only, with valid URL and no cache
...........  --url-only, with valid URL, invalid file w/fn, and no cache
...........  basic config test.
...........  {:cwd-zprintrc? true} on command line test
...........  {:search-config? true} on command line test
...........  ~/.zprintrc being used test
...........  -d test -- ~/.zprintrc should not be used
...........  bad ~/.zprintrc, invalid Clojure map test
...........  invalid zprint options map in ~/.zprintrc
...........  -v test
...........  -h test
...........  -e test
...........  :coerce-to-false test
...........  fn in ~/.zprintrc file test (works for uberjar, fails for graalvm)
...........  fn is invalid in ./.zprintrc file test
...........  fn on command line test (works for uberjar, fails for graalvm)

I built a mac native image with Graal via:

./build.zprintm /Users/lee/.sdkman/candidates/java/20.1.0.r8-grl target/zprint-filter-1.0.0 zprintm-1.0.0

And then ran:

./test_config 1.0.0 graalvm-mac

Which returned identical output as ./test-config 1.0.0 uberjar, so that seems good.

lread

comment created time in a month

more