Skip to content

Commit

Permalink
version 1-alpha7: handling vars and nils differently
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Sep 22, 2023
1 parent 5e40785 commit 93609ce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).

## [1-alpha7] - 2023-09-22
- handling vars and nils differently

## [1-alpha6] - 2023-09-01
- testing value metadata

Expand Down
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[org.corfield.build :as bb]))

(def lib 'org.scicloj/note-to-test)
(def version "1-alpha6")
(def version "1-alpha7")
#_ ; alternatively, use MAJOR.MINOR.COMMITS:
(def version (format "1.0.%s" (b/git-count-revs nil)))

Expand Down
7 changes: 4 additions & 3 deletions src/scicloj/note_to_test/v1/impl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@

(defn represent-value-with-meta [v]
(cond
;; handle a var
(var? v)
[:var]
;; handle a var or a nil
(or (var? v)
(nil? v))
:var-or-nil
;; else
:else
{:value (-> v represent-value)
Expand Down
2 changes: 1 addition & 1 deletion test/dum/dummy_generated_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
(is (= (note-to-test/represent-value-with-meta
(defn f [x]
(+ x 19)))
[:var]))
:var-or-nil))

(is (= (note-to-test/represent-value-with-meta
(f 12))
Expand Down

0 comments on commit 93609ce

Please sign in to comment.