Can't create a function called `load`

24 views
Skip to first unread message

outr...@gmail.com

unread,
Nov 29, 2021, 1:05:54 AM11/29/21
to ClojureScript
As the subject says, I recently tried to create a function called `load` which for some reason wasn't executing properly. The body isn't relevant, since it turned out that whatever I put in the body wasn't executing at all. I eventually discovered, when I renamed the function, that the body worked fine, it was just the name `load` that was causing it to be ignored.

I created a fresh environment, with ClojureScript version 1.10.879, running figwheel 0.2.14, and tried just calling `(load) as soon as the prompt came up.

```
(load)
;; nil
```

```
(load 1)
;; Compile Exception: Don't know how to create ISeq from: java.lang.Long 
```

I even tried:

```
#'load
;; Could not Analyze: Unable to resolve var: load in this context in file <cljs repl> 
```

and

```
`load
;; cljs.user/load
```

I even tried to do this:

```
(refer-clojure :exclude '[load])
```

but it made no difference.

This is no big deal as I managed to rename the original function, but the thing is I can't find any trace of there being a `load` function anywhere in the docs, it doesn't seem to be a special form function or anything like that, and there is no macro with that name.

So the big question: what is `load` and why can't I create a function with that name? Further, are there any other "hidden" keywords which are otherwise valid but which I can't use to create functions?


Reply all
Reply to author
Forward
0 new messages