Consider this ClojureScript code:
(defn foo []
(let [location 12345] (prn js/location.hash)))
This won't work. js/ isn't a real namespace. This code will throw an exception at runtime.
The reason is that the code expands to this JS snippet:
| (setq lexical-binding t) | |
| (defun cider-eval-pprint-to-multiline-comment-handler (buffer location arrow-prefix comment-prefix) | |
| "Make a handler for evaluating and printing commented results in BUFFER. | |
| LOCATION is the location at which to insert. | |
| COMMENT-PREFIX is the comment prefix to use." | |
| (cl-flet ((multiline-comment-handler (buffer value) | |
| (with-current-buffer buffer | |
| (save-excursion |
Consider this ClojureScript code:
(defn foo []
(let [location 12345] (prn js/location.hash)))
This won't work. js/ isn't a real namespace. This code will throw an exception at runtime.
The reason is that the code expands to this JS snippet:
| int[][] result; | |
| float t, c; | |
| float ease(float p) { | |
| return 3*p*p - 2*p*p*p; | |
| } | |
| float ease(float p, float g) { | |
| if (p < 0.5) | |
| return 0.5 * pow(2*p, g); |
| /* Copyright (c) 2018 Arvid Gerstmann. */ | |
| /* This code is licensed under MIT license. */ | |
| #ifndef AG_RANDOM_H | |
| #define AG_RANDOM_H | |
| class splitmix | |
| { | |
| public: | |
| using result_type = uint32_t; | |
| static constexpr result_type (min)() { return 0; } |