Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add reference/javascript-interop-ref.adoc#95

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mobileink wants to merge9 commits intoclojure:master
base:master
Choose a base branch
Loading
frommobileink:interop-ref

Conversation

mobileink
Copy link

First draft

Gregg Reynolds added9 commitsJune 26, 2017 12:18
Signed-off-by: Gregg Reynolds <reynolds-gregg@norc.org>
Signed-off-by: Gregg Reynolds <reynolds-gregg@norc.org>
Signed-off-by: Gregg Reynolds <reynolds-gregg@norc.org>
Signed-off-by: Gregg Reynolds <reynolds-gregg@norc.org>
Convert some of the Java lingo to Javascript (e.g. s/instance/object/)FIXME indicates places where content is missing or verifiedDELETE indicates code from the clj doco that i think does not apply to cljsSigned-off-by: Gregg Reynolds <reynolds-gregg@norc.org>
Signed-off-by: Gregg Reynolds <reynolds-gregg@norc.org>
Signed-off-by: Gregg Reynolds <reynolds-gregg@norc.org>
Signed-off-by: Gregg Reynolds <reynolds-gregg@norc.org>
@mfikes
Copy link
Member

@mobileink Thanks! This draft is looking pretty good! I'd be happy to contribute when you get to the point where you are interested in feedback.

@mobileink
Copy link
Author

Thanks for reminding me. Life intervened, but I hope to get back to this soon.

@holyjak
Copy link
Contributor

I am very much looking forward to this, we really need this guide. Any way other people can help you,@mobileink ?


Non-goals:

* user guide - that goes in link:../guides/javascript-interop-guide.adoc[Javascript Interop Guide]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

(when somebody creates it :))

Copy link
Contributor

@holyjakholyjakJan 21, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

----
#js {:a 1 :b 2}
-> #js {:a 1, :b 2}
(js-obj :a 1 :b 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think that forjs-obj we need to use string keys, otherwise we end up with the js object{ ':a': 1, ':b': 2 }, which likely is not desriable. Worth pointing out that#js converts:kwd -> "kwd" (and::kwd -> ":kwd".

We should also mentioned that#js is not recursive, i.e. I need#js {:child #js {:isKid true} :isParent true}

has (proto)types, objects, field properties, and method properties.
In the following, we will drop "property" and refer to "fields" and
"methods".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

also remind the user that objects in the global context need to be accessed viajs/, contrary to the direct access in JS itself?


TODO: make this readable

For interacting with Javascript objects, use `goog.object` rather than `aget`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Perhaps also mentionhttps://github.com/binaryage/cljs-oops as an alternative? It is already mentioned at cljs.info/cheatsheet/

Special form.

The args, if any, are evaluated from left to right, and passed to the constructor of the class named by Classname. The constructed object is returned.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

  • this:

Note that if Typename is defined within a module, you simply prepend the module name with a dot, just as you would do in #"json" data-turbo="false" action="/clojure/clojurescript-site/pull/95/review_comment/162802557" accept-charset="UTF-8" method="post">

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@holyjakholyjakholyjak left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@mobileink@mfikes@holyjak

[8]ページ先頭

©2009-2025 Movatter.jp