Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic operations on return of aget rejected #27

Open
timsgardner opened this issue Aug 17, 2015 · 1 comment
Open

basic operations on return of aget rejected #27

timsgardner opened this issue Aug 17, 2015 · 1 comment

Comments

@timsgardner
Copy link

(require '[gamma.api :as g])
(g/+ 1 (g/aget (g/vec3 2) 0))

throws:

gamma-tools.core=> System.Exception: Arguments to + must have type :int or :float
  at gamma/api$_PLUS___172.invoke (System.Object , System.Object ) [0x000a1] in api.clj:210 
  at gamma_tools/core$eval__3333__3338.invoke () [0x00000] in <filename unknown>:0 
  at clojure.lang.Compiler.eval (System.Object form) [0x00000] in <filename unknown>:0 
  at clojure.lang.Compiler.eval (System.Object form) [0x00000] in <filename unknown>:0 
  at clojure/core$eval__57691.invoke (System.Object ) [0x00000] in core.clj:3076 
  at arcadia/repl$repl_eval_print$fn__28359__28363.invoke () [0x001e3] in repl.clj:59 
  at arcadia/repl$repl_eval_print__28366.invoke (System.Object , System.Object ) [0x0041e] in repl.clj:57 
  at arcadia/repl$repl_eval_string__28382.invoke (System.Object , System.Object ) [0x0002f] in repl.clj:75 
  at arcadia/repl$repl_eval_string__28382.invoke (System.Object ) [0x00000] in repl.clj:72 
  at arcadia/repl$eval_queue$fn__28390__28394.invoke () [0x00000] in repl.clj:84 

and

(g/float (g/aget (g/vec3 1) 0))

throws:

gamma-tools.core=> System.Exception: Wrong argument types for term float: 
  at gamma/api$build_standard_function_term__284.invoke (System.Object , System.Object , System.Object ) [0x00110] in api.clj:329 
  at gamma/api$float__338.doInvoke (System.Object ) [0x00000] in api.clj:331 
  at clojure.lang.RestFn.invoke (System.Object arg1) [0x00000] in <filename unknown>:0 
  at gamma_tools/core$eval__3347__3352.invoke () [0x00000] in <filename unknown>:0 
  at clojure.lang.Compiler.eval (System.Object form) [0x00000] in <filename unknown>:0 
  at clojure.lang.Compiler.eval (System.Object form) [0x00000] in <filename unknown>:0 
  at clojure/core$eval__57691.invoke (System.Object ) [0x00000] in core.clj:3076 
  at arcadia/repl$repl_eval_print$fn__28359__28363.invoke () [0x001e3] in repl.clj:59 
  at arcadia/repl$repl_eval_print__28366.invoke (System.Object , System.Object ) [0x0041e] in repl.clj:57 
  at arcadia/repl$repl_eval_string__28382.invoke (System.Object , System.Object ) [0x0002f] in repl.clj:75 
  at arcadia/repl$repl_eval_string__28382.invoke (System.Object ) [0x00000] in repl.clj:72 
  at arcadia/repl$eval_queue$fn__28390__28394.invoke () [0x00000] in repl.clj:84 
@timsgardner
Copy link
Author

This seems to work as an alternative to aget in many situations:

(defn hero-aget [v i]
  (g/+ 0 (g/aget v (g/int i))))

(assuming #29)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant