"Meikel Brandmeyer (kotarak)" writes:
> you are right. require-owl also works as a function:
>
> (defn require-owl
> [file & {nspace :namespace :or {nspace *ns*}}]
> (with-open [rdr (io/reader file)]
> (doseq [entry (owl-seq rdr)
> :let [entry-name (translate-name (:name entry)
Hi,
you are right. require-owl also works as a function:
(defn require-owl
[file & {nspace :namespace :or {nspace *ns*}}]
(with-open [rdr (io/reader file)]
(doseq [entry (owl-seq rdr)
:let [entry-name (translate-name (:name entry))]]
(intern nspace entry-name (:init entr
"Meikel Brandmeyer (kotarak)" writes:
> Am Montag, 23. September 2013 11:37:10 UTC+2 schrieb Phillip Lord:
>>
>> So, now I can refer to an OWL file in
>> exactly the same way as if it were written in Clojure.
>>
>
> Ok. So, it is correct to think of this as a fancy require-owl, isn't it?
> Then
Hi,
Am Montag, 23. September 2013 11:37:10 UTC+2 schrieb Phillip Lord:
>
> So, now I can refer to an OWL file in
> exactly the same way as if it were written in Clojure.
>
Ok. So, it is correct to think of this as a fancy require-owl, isn't it?
Then this means you read the OWL files at compilat
"Meikel Brandmeyer (kotarak)" writes:
> don't get me wrong: I don't want to discuss away your use case! But I don't
> understand it, yet. After your calling intern, do you compile other code
> referencing the created Vars? If no: why do you need Vars? If yes: why
> don't you just generate cod
Hi,
don't get me wrong: I don't want to discuss away your use case! But I don't
understand it, yet. After your calling intern, do you compile other code
referencing the created Vars? If no: why do you need Vars? If yes: why
don't you just generate code with a def and compile it?
Meikel
--
--
Gary Verhaegen writes:
> Well, do actually means "execute all of the following forms, sequentially,
> at this point". It seems to me that the position of saying this also works
> when "this point" is the top-level is sensible.
Perhaps; what does not seem sensible is that it *only* works at
top-
Well, do actually means "execute all of the following forms, sequentially,
at this point". It seems to me that the position of saying this also works
when "this point" is the top-level is sensible.
I do not know what your actual use-case is, but, as Meikel said, it seems a
bit strange to use inter
Meikel Brandmeyer writes:
> 2013/9/20 Phillip Lord
>> (def bob3 3)
>>
>> introduces a new symbol, I am struggling to see why
>>
>> (intern 'user 'bob3 3)
>>
>> cannot be recognised similarly.
>>
>
> Because intern happens at runtime. It's a normal function. The above intern
> call is easily trans
Hi,
2013/9/20 Phillip Lord
>
> (def bob3 3)
>
> introduces a new symbol, I am struggling to see why
>
> (intern 'user 'bob3 3)
>
> cannot be recognised similarly.
>
Because intern happens at runtime. It's a normal function. The above intern
call is easily translated to the def. intern is only i
Gary Verhaegen writes:
> As Meikel said in his previous mail, 'do' at the top-level is treated
> specially: each form is treated as a separate top-level form. This is, for
> example, useful for defining a macro that defines multiple functions.
I'd be interested to see an example, where this beh
Not that I am aware of. do is special to allow macros expanding into
several defs where the later depend on the former.
(defmacro foo [a b]
`(do
(def ~a 5)
(def ~b ~a)))
This is necessary, because a macro can only return one form.
And the name resolution for ns is special-cased, IIRC
This is interesting - are there any other cases where forms are treated
specially at top-level?
On 20 September 2013 10:01, Gary Verhaegen wrote:
> As Meikel said in his previous mail, 'do' at the top-level is treated
> specially: each form is treated as a separate top-level form. This is, for
As Meikel said in his previous mail, 'do' at the top-level is treated
specially: each form is treated as a separate top-level form. This is, for
example, useful for defining a macro that defines multiple functions.
So what Meikel was really trying to say is that the reason (do (intern
'user 'bob3
"Meikel Brandmeyer (kotarak)" writes:
> Clojure's compile unit is one toplevel form. Therefore
>
> (intern 'user 'bob3 3)
> bob3
>
> works, while
>
> (is (do (intern 'user 'bob2 2) bob2))
>
> does not, because the former are two compilation units while the latter is
> only one. (Note: (do ...) i
Hi,
Clojure's compile unit is one toplevel form. Therefore
(intern 'user 'bob3 3)
bob3
works, while
(is (do (intern 'user 'bob2 2) bob2))
does not, because the former are two compilation units while the latter is
only one. (Note: (do ...) is a special case. (do (intern 'user 'bob3 3)
bob3)
In a clean repl, try the following...
(use 'clojure.test)
(is (do (intern 'user 'bob2 2) bob2))
(is (do (def bob3 3) bob3))
The first is form breaks with a "Unable to resolve symbol" error
at the compilation stage. The second one, on the other hand is quite
happy.
Now, I guess what is happeni
17 matches
Mail list logo