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

The documentation for vertical-panel should say it uses a vector, not a list #131

Open
DanKaplanSES opened this issue Apr 14, 2013 · 4 comments

Comments

@DanKaplanSES
Copy link

The documentation for vertical-panel says:

:items List of widgets (passed through make-widget)

But, as far as I can tell from a wiki example, it really takes a vector, not a list. This documentation made me try to call it like this:

(vertical-panel :items '(b1 b2))

and I had to google for an example to see what I was doing wrong.

@daveray
Copy link
Collaborator

daveray commented Apr 15, 2013

Yeah, it really should read "sequence of widgets" because it could be [b1 b2], (list b1 b2), (map identity [b1 b2]), etc. I was using List in a more generic sense than Clojures persistent list collections.

@DanKaplanSES
Copy link
Author

I'm very new to clojure but I thought (list b1 b2) is the same as '(b1 b2). I tried the latter, and it gave me an error (I don't remember what it was. Probably something about how it can't cast to ISeq.

@daveray
Copy link
Collaborator

daveray commented Apr 15, 2013

The distinction is in how the expression is evaluated. (list b1 b2) is evaluated as: "evaluate b1, evaluate b2, pass those results as args to the list function". In the case of '(b1 b2), the quote disables the evaluation of b1 and b2 so you end up passing a two element list of raw symbols to seesaw.

@DanKaplanSES
Copy link
Author

Ah that makes sense. Thanks for explaining that.

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