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

Allow components to refer to themselves. #30

Merged
merged 1 commit into from
Jun 14, 2015
Merged

Conversation

lynaghk
Copy link
Contributor

@lynaghk lynaghk commented Jun 10, 2015

Declaring the component name at the top of the let will allow the render
body to invoke the component.

declare for side-effects within a let is ugly, but better than the
alternatives:

  • No way to replace let with letfn since the render body won't be
    calling itself.
  • Putting the declare outside of the let would require the macro
    splicing, which is trickier to understand and requires more syntax

Declaring the component name at the top of the let will allow the render
body to invoke the component.

`declare` for side-effects within a let is ugly, but better than the
alternatives:

+ No way to replace `let` with `letfn` since the render body won't be
calling itself.

+ Putting the `declare` outside of the let would require the macro
splicing, which is trickier to understand and requires more syntax
@lynaghk
Copy link
Contributor Author

lynaghk commented Jun 10, 2015

Note that I wasn't able to test this commit; boot gave me the following error:

kevin@nu:~/software/rum$ boot install
             clojure.lang.ExceptionInfo: java.lang.Exception: can't find jar file
    data: {:file
           "/var/folders/fm/fmgnykm11tjc0_g6jr1h7kch0000gn/T/boot.user4483160175845386140.clj",
           :line 23}
java.util.concurrent.ExecutionException: java.lang.Exception: can't find jar file
                    java.lang.Exception: can't find jar file
     boot.task.built-in/fn/fn/fn/fn                      built_in.clj:  625
                boot.core/run-tasks                          core.clj:  680
                                ...
               boot.user/eval786/fn  boot.user4483160175845386140.clj:   25
clojure.core/binding-conveyor-fn/fn                          core.clj: 1910
                                ...

I don't use boot; I installed it via homebrew:

kevin@nu:~/software/rum$ boot --version
#https://github.com/boot-clj/boot
#Wed Jun 10 15:49:26 PDT 2015
BOOT_CLOJURE_VERSION=1.6.0
BOOT_VERSION=2.0.0-rc14
#App version: 2.0.0

tonsky added a commit that referenced this pull request Jun 14, 2015
Allow components to refer to themselves.
@tonsky tonsky merged commit ace98e7 into tonsky:gh-pages Jun 14, 2015
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

Successfully merging this pull request may close these issues.

2 participants