Fork me on GitHub
#klipse
<
2016-12-07
>
Yehonathan Sharvit16:12:03

@jrheard I want to publish a “Hall of fame of web pages with interactive code”. I have started to work on it

Yehonathan Sharvit16:12:13

But I’m not such a good designer

Yehonathan Sharvit16:12:22

Maybe you have a couple of advice to improve the page

Yehonathan Sharvit16:12:06

For the moment, it mentions only 2 pages but I have already 10 that I will had later - when I’m done with the layout

Yehonathan Sharvit16:12:41

@hmadelaine maybe you could help with ⬆️ ?

jrheard16:12:00

@viebel looks good so far! i like the gifs, great way of communicating the articles’ interactivity the only nitpick i have is that the facebook like widget seems out of place - i think i’d remove it entirely and the reddit links look pretty good, but they take up a moderate amount of space and probably don’t actually provide much value to the person reading the article - i’d probably remove the reddit widgets too aside from that, i can’t think of anything i’d change!

jrheard16:12:52

(although perhaps 'the best interacitve web pages with interactive code’ could be reworded (and the first ‘interactive' has a typo); not sure what i’d use instead, thinking)

jrheard16:12:43

i like what you used in your slack message a bit better: “Hall of fame of web pages with interactive code"

jrheard16:12:50

i think it’s nice and simple

Yehonathan Sharvit16:12:05

I like it more also

Yehonathan Sharvit16:12:01

another thing @jrheard related to console.log in klipse snippets

Yehonathan Sharvit16:12:41

First of all, I implemented your idea, and now, when you print inside a clojure code snippets the result is appended to the result cell

Yehonathan Sharvit16:12:12

But it doesn’t play well with asynchronous code like setTimeout

Yehonathan Sharvit16:12:49

The was I did it is with (binding [*print-fn* …)

jrheard16:12:00

nice, makes sense

Yehonathan Sharvit16:12:25

but dynamic scope and asynchronous stuff cannot work

Yehonathan Sharvit16:12:31

or at least not for the moment

Yehonathan Sharvit16:12:09

Anyway, that’s not my issue

Yehonathan Sharvit16:12:20

For clojure, I am not trying to solve it for the moment

Yehonathan Sharvit16:12:31

But I think I found a solution for javascript

Yehonathan Sharvit16:12:36

using lexical scope

Yehonathan Sharvit16:12:55

instead of (js/eval exp)

Yehonathan Sharvit16:12:37

I’m wrapping exp into an anonymous function with console like this

Yehonathan Sharvit16:12:57

function(console) {
eval(exp);
}({log: myLogger})

Yehonathan Sharvit16:12:04

and it works fine!!!!

jrheard16:12:57

gotcha, yeah, you’ve gotta pass along some sort of way of associating the evaluation with the specific klipse snippet you want the output to be written to, is that right?

Yehonathan Sharvit16:12:16

now I’d like to go one step further

Yehonathan Sharvit16:12:29

to handle calls to console.time, console.error etc...

Yehonathan Sharvit16:12:04

But I don’t want to override all of them

Yehonathan Sharvit16:12:34

my question is: do you think there is a common printer function called by console.log, console.time, console.error etc...

Yehonathan Sharvit16:12:46

Then I’d need to override only one function

jrheard16:12:10

hm, i wonder if there’s a way to see the source of those functions, i’ve never tried to do that

jrheard16:12:12

perhaps not, checking

jrheard16:12:21

i bet it varies from browser to browser

jrheard16:12:11

yeah, not sure how to see that