-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
awb99
committed
Apr 17, 2024
1 parent
56493af
commit ef4de1c
Showing
6 changed files
with
33 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns demo.notebook.javelin | ||
(:require | ||
[javelin.core :refer [cell] :refer-macros [cell=]])) | ||
|
||
(defn start [] | ||
(let [a (cell 0) ;; input cell with initial value of 0. | ||
b (cell= (inc a)) ;; formula cell of a+1. | ||
c (cell= (+ 123 a b))] ;; formula cell of a+b+123. | ||
(cell= (.log js/console c)) ;; anonymous formula cell for side effects. | ||
;; c's initial value, 124, is printed. | ||
(swap! a inc) | ||
;; a was incremented, and its new value propagated (consistently) | ||
;; through b and c. c's new value, 126, is printed to the console. | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters