Skip to content

Allow components to refer to themselves.#30

Merged
tonsky merged 1 commit into
tonsky:gh-pagesfrom
lynaghk:gh-pages
Jun 14, 2015
Merged

Allow components to refer to themselves.#30
tonsky merged 1 commit into
tonsky:gh-pagesfrom
lynaghk:gh-pages

Conversation

@lynaghk
Copy link
Copy Markdown
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
Copy Markdown
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