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

Can't use strings as iterators in mori.map #79

Closed
aearly opened this issue Jun 23, 2014 · 2 comments
Closed

Can't use strings as iterators in mori.map #79

aearly opened this issue Jun 23, 2014 · 2 comments

Comments

@aearly
Copy link
Contributor

aearly commented Jun 23, 2014

Taken from the docs (and converted to JS):

    var bob = m.hash_map("first", "Bob", "last", "Smith"),
      mary = m.hash_map("first", "Mary", "last", "Jane"),
      result = m.map("first", m.vector(bob, mary));

    console.log(result); // throws exception "TypeError: undefined is not a function"
    expect(m.clj_to_js(result)).to.eql(["Bob", "Mary"]); // converting to JS also throws

It also fails if you map over a plain [bob, mary] as in the docs.

For now, I'll just use a function (val) { return m.get("first"); } function as a workaround, just wanted to let you know the docs are inaccurate.

@swannodette
Copy link
Owner

Yes the docs are wrong, that will no longer be supported. Doc pull request welcome.

@swannodette
Copy link
Owner

Fixed

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

2 participants