You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To better support the Design Journal suggested in this REPL Driven Development Guide, Calva should make it easy to evaluate the top level form and add the result as a ;; comment.
Here's the Documentation First:
Evaluate to comment
Calva has two commands for evaluating code and add as a comment in the file being edited:
Evaluate current form, and append a comment with the result, ctrl+alt+c, c
Evaluate current top level form, and append a comment with the result, ctrl+alt+c, ctrl+space
As with all commands for evaluating the top level form, they also work inside (comment) forms. This makes it smooth to build a Design Journal like this at the end of your file:
(comment;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; REPL Experiments;;;;;;;;;;;;;;;;;;;;;;;;;; Generating a data structure to represet the game board;; We could just hard code the board as follows, although that limits us to a specific size of board:
[[:empty:empty:empty]
[:empty:empty:empty]
[:empty:empty:empty]]
;; To create a row is simple to do using the repeat function to generate 3 :empty keywords and return them as a list
(repeat3:empty)
;; => (:empty :empty :empty);; To make this a vector we can just wrap that in a vec function
(vec (repeat3:empty))
;; => [:empty :empty :empty];; To create three rows we just repeat the code above 3 times
(vec (repeat3 (vec (repeat3:empty))))
;; => [[:empty :empty :empty] [:empty :empty :empty] [:empty :empty :empty]];; And so on, and so forth
...)
The text was updated successfully, but these errors were encountered:
To better support the Design Journal suggested in this REPL Driven Development Guide, Calva should make it easy to evaluate the top level form and add the result as a
;;
comment.Here's the Documentation First:
Evaluate to comment
Calva has two commands for evaluating code and add as a comment in the file being edited:
As with all commands for evaluating the top level form, they also work inside
(comment)
forms. This makes it smooth to build a Design Journal like this at the end of your file:The text was updated successfully, but these errors were encountered: