Giter VIP home page Giter VIP logo

Comments (9)

mcohen01 avatar mcohen01 commented on July 25, 2024

0.1.2 will let you pass a lazy-sec

https://github.com/clojure/algo.generic/blob/master/src/main/clojure/clojure/algo/generic/functor.clj

from amazonica.

neilprosser avatar neilprosser commented on July 25, 2024

Am I doing something stupid here?

With a fresh clone of the repo and lein repl I run these two commands:

(use 'amazonica.aws.autoscaling)
(create-launch-configuration :security-groups (seq ["hello" "world"]))

... and I still get that error.

from amazonica.

mcohen01 avatar mcohen01 commented on July 25, 2024

Try (lazy-seq) instead of (seq)
On Apr 2, 2014 8:04 AM, "Neil Prosser" [email protected] wrote:

Am I doing something stupid here?

With a fresh clone of the repo and lein repl I run these two commands:

(use 'amazonica.aws.autoscaling)(create-launch-configuration :security-groups (seq ["hello" "world"]))

... and I still get that error.

Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-39341442
.

from amazonica.

neilprosser avatar neilprosser commented on July 25, 2024

That worked but it still means users are going to have to consider adding vec or lazy-seq to every collection parameter they use with the library.

from amazonica.

neilprosser avatar neilprosser commented on July 25, 2024

I've created this issue to see what the algo.generic auther makes of it. Hopefully help you avoid having to do anything beyond changing the version.

from amazonica.

mcohen01 avatar mcohen01 commented on July 25, 2024

You would only have to wrap a ChunkedSeq in a vec or lazy-seq call, or some other concrete collection type that doesn't implement an interface supported by algo.generic.

Calling seq on a vector is basically the only way I see to get a ChunkedSeq. (with-meta produces one too but that's not really applicable to most cases.)

Can you show your actual call to map that's producing the ChunkedSeq?

In a repl you can see it's probably rare that you're going to be dealing with ChunkedSeqs

(class (map identity [1 2 3])) ;;clojure.lang.LazySeq
(class (map identity '(1 2 3))) ;;clojure.lang.LazySeq

(class (seq [1 2 3])) ;; clojure.lang.PersistentVector$ChunkedSeq
(class (lazy-seq [1 2 3])) ;;clojure.lang.LazySeq

from amazonica.

mcohen01 avatar mcohen01 commented on July 25, 2024

I see the issue you created on algo.generic. You could implement fmap for ISeq to handle this special case.

from amazonica.

mcohen01 avatar mcohen01 commented on July 25, 2024

clojure/algo.generic#4

from amazonica.

neilprosser avatar neilprosser commented on July 25, 2024

Sorry, I've worked out that it's not coming from map. I'm an idiot. The ChunkedSeq is coming from me doing (seq something-mapped) so I get nil in the case of an empty sequence (which is more convenient than having to check count or similar). My map examples are all giving back LazySeq.

I'll probably be able to just use the original mapped sequence, rather than the one which has gone through the seq.

However, now I see that you've done the work on algo.generic. You sir, are a legend!

from amazonica.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.