Paste number 100473: (eval `(def foo ...))

Paste number 100473: (eval `(def foo ...))
Pasted by: DeusExPikachu
When:1 year, 11 months ago
Share:Tweet this! | http://paste.lisp.org/+25IX
Channel:#clojure
Paste contents:
Raw Source | XML | Display As
classloader.clj

(ns 'dj.classloader)

(defmacro with-new-classloader [& body]
  "running in an eval implicitly creates a new classloader"
  `(eval
    `(let [classloader 'foo]
       (def the-cl classloader)
       ~~@body)))

cli/repl.clj

(ns 'dj.cli.repl
  (:require [dj.classloader :as cl]))

(defn main []
  (cl/with-new-classloader
    (clojure.main/main)))

in the repl
Clojure 1.2.0-master-SNAPSHOT
user=> (in-ns 'dj.cli.repl)
#<Namespace dj.cli.repl>
dj.cli.repl=> the-cl
java.lang.Exception: Unable to resolve symbol: the-cl in this context (NO_SOURCE_FILE:1)
dj.cli.repl=> 

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.