Skip to content

Commit

Permalink
Merge pull request #511 from hellerve/todo
Browse files Browse the repository at this point in the history
Add todo macro
  • Loading branch information
eriksvedang authored Jun 27, 2019
2 parents 2ea8d09 + f60f72f commit af127da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/Long.carp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
(register dec (λ [Long] Long))
(register to-int (λ [Long] Int))
(register from-int (λ [Int] Long))
(register copy (λ [&Long] Long)) ;; TODO: Should not be needed when refs to value types are auto-converted to non-refs.
(todo copy "Should not be needed when refs to value types are auto-converted
to non-refs.")
(register copy (λ [&Long] Long))

(defn /= [x y]
(not (Long.= x y)))
Expand Down
10 changes: 8 additions & 2 deletions core/Macros.carp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@
(defmacro private [name]
(list 'meta-set! name "private" true))

(doc todo "sets the todo property for a binding.")
(defmacro todo [name value]
(list 'meta-set! name "todo" value))

(doc private? "Is this binding private?")
(todo private? "This is buggy, will report true when meta is set to 'false'!")
(defmacro private? [name]
(list 'not (list '= () (list 'meta name "private")))) ;; TODO: This is buggy, will report true when meta is set to 'false'!
(list 'not (list '= () (list 'meta name "private"))))

(doc hidden? "Is this binding hidden?")
(todo hidden? "This is buggy, will report true when meta is set to 'false'!")
(defmacro hidden? [name]
(list 'not (list '= () (list 'meta name "hidden")))) ;; TODO: This is buggy, will report true when meta is set to 'false'!
(list 'not (list '= () (list 'meta name "hidden"))))

(defndynamic annotate-helper [name annotation]
(cons annotation (meta name "annotations")))
Expand Down

0 comments on commit af127da

Please sign in to comment.