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

Add Lisps and lists README section after issue #8 #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,28 @@ your primary classloader.
(eval '*clojure-version*)
;; {:major 1, :minor 2, :incremental 0, :qualifier ""}

#### Lisps and lists

A quick note that can save you from despair. The third parameter to `eval-in` is a quoted list and won't be treated any differently from what we are used to in Lisps. Having said that, if you are closing over something and you use unquote like this:

(let [list-of-strings (map str (range 10))]
(classlojure/eval-in cl
`(println ~list-of-strings)))

You shouldn't be surprised by the dreaded `java.lang.String cannot be cast to clojure.lang.IFn`; the first item of the list is indeed a string and not a function as Lisps dictate.

You need something more sophisticated in order for the above to work:

(let [list-of-strings (map str (range 10))]
(classlojure/eval-in cl
`(println '~list-of-strings)))

The order counts here. You first evaluate `list-of-strings` and get a list back which thereafter you quote so that it is not expected to have a function in first position.

## YourKit

YourKit is kindly supporting open source projects with its full-featured Java Profiler.
YourKit, LLC is the creator of innovative and intelligent tools for profiling
Java and .NET applications. Take a look at YourKit's leading software products:
[YourKit Java Profiler](http://www.yourkit.com/java/profiler/index.jsp) and
[YourKit .NET Profiler](http://www.yourkit.com/.net/profiler/index.jsp).
[YourKit .NET Profiler](http://www.yourkit.com/.net/profiler/index.jsp).