Skip to content

Commit

Permalink
Fixed several macro definitions which in which this was not gensym'd (
Browse files Browse the repository at this point in the history
  • Loading branch information
k13gomez authored Mar 3, 2024
1 parent 3dc51b2 commit 853576f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions src/ham_fisted/function.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(defmacro bi-consumer
[arg1 arg2 & code]
`(reify BiConsumer
(accept [this ~arg1 ~arg2]
(accept [this# ~arg1 ~arg2]
~@code)))


Expand All @@ -46,7 +46,7 @@
"Create a function that converts objects to longs"
([]
`(reify IFnDef$OL
(invokePrim [this v#]
(invokePrim [this# v#]
(Casts/longCast v#))))
([varname & code]
`(reify IFnDef$OL
Expand All @@ -58,39 +58,39 @@
"Create a function that converts objects to doubles"
([]
`(reify IFnDef$OD
(invokePrim [this v#]
(invokePrim [this# v#]
(Casts/doubleCast v#))))
([varname & code]
`(reify IFnDef$OD
(invokePrim [this ~varname]
(invokePrim [this# ~varname]
(Casts/doubleCast ~@code)))))


(defmacro long->double
"Create a function that receives a long and returns a double"
[varname & code]
`(reify IFnDef$LD
(invokePrim [this ~varname] ~@code)))
(invokePrim [this# ~varname] ~@code)))


(defmacro double->long
"Create a function that receives a double and returns a long"
[varname & code]
`(reify IFnDef$DL
(invokePrim [this ~varname] ~@code)))
(invokePrim [this# ~varname] ~@code)))


(defmacro long->obj
"Create a function that receives a primitive long and returns an object."
[varname & code]
`(reify IFnDef$LO
(invokePrim [this ~varname] ~@code)))
(invokePrim [this# ~varname] ~@code)))


(defmacro double->obj
[varname & code]
`(reify IFnDef$DO
(invokePrim [this ~varname] ~@code)))
(invokePrim [this# ~varname] ~@code)))


(defn ->function
Expand All @@ -107,7 +107,7 @@
[varname & code]
`(reify
IFnDef$DoublePredicate
(test [this ~varname]
(test [this# ~varname]
~@code)))


Expand All @@ -125,7 +125,7 @@
[varname & code]
`(reify
IFnDef$LongPredicate
(test [this ~varname]
(test [this# ~varname]
~@code)))


Expand All @@ -150,7 +150,7 @@
[varname & code]
`(reify
IFnDef$Predicate
(test [this ~varname]
(test [this# ~varname]
~@code)))


Expand Down Expand Up @@ -326,7 +326,7 @@
[lvar rvar & code]
`(reify
LongBinaryOperator
(applyAsLong [this ~lvar ~rvar]
(applyAsLong [this# ~lvar ~rvar]
~@code)
IFnDef$LLL
(invokePrim [this# l# r#]
Expand Down
4 changes: 2 additions & 2 deletions src/ham_fisted/reduce.clj
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ ham-fisted.api> @*1
```"
[accvar varvar & code]
`(reify IFnDef$ODO
(invokePrim [this ~accvar ~varvar]
(invokePrim [this# ~accvar ~varvar]
~@code)))


Expand All @@ -173,7 +173,7 @@ ham-fisted.api> @*1
```"
[accvar varvar & code]
`(reify IFnDef$OLO
(invokePrim [this ~accvar ~varvar]
(invokePrim [this# ~accvar ~varvar]
~@code)))

(defn immut-map-kv
Expand Down

0 comments on commit 853576f

Please sign in to comment.