Closed danburkert closed 11 years ago
seq-of
is a function in the byte-streams
namespace. Are you fully qualifying the name? Admittedly, I could do this for you in the def-transform
macro, but that wouldn't work in convert
.
Yes, I have tried it fully qualified and through a :require alias. Here is an example that shows the error:
(ns example
(:require [byte-streams :as bs])
(:import [java.io OutputStream]))
;; works fine
(bs/def-conversion [OutputStream (bs/seq-of String)]
[os]
nil)
;; CompilerException java.lang.RuntimeException: Unable to resolve symbol: seq-of in this context
(bs/def-transfer [(bs/seq-of String) OutputStream]
[strings os]
nil)
Now, interestingly, if I :use bytes-streams
, it works fine:
(ns example
(:use [byte-streams])
(:import [java.io OutputStream]))
;; works fine
(def-conversion [OutputStream (seq-of String)]
[os]
nil)
;; works fine
(def-transfer [(seq-of String) OutputStream]
[strings os]
nil)
Also, something I've noticed is def-conversion
returns nil
, whereas def-transfer
returns the new value of the src->dst->transfer
atom. Thanks for helping me track this down.
Hmm, that's weird, that should work in either case. I'll take a look.
This is fixed in 0.1.3
Would it be possible to extend the library to allow defining transfers from
(seq-of MyBytesSource)
->OtherSink
? Currently when I try this I get ajava.lang.RuntimeException: Unable to resolve symbol: seq-of in this context
.