klipse 2016-12-07

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

But I’m not such a good designer

Maybe you have a couple of advice to improve the page

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

@hmadelaine maybe you could help with ⬆️ ?

@hmadelaine has joined the channel

@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!

ok

(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)

thanks for your input @jrheard

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

i think it’s nice and simple

ok.

I like it more also

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

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

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

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

nice, makes sense

but dynamic scope and asynchronous stuff cannot work

or at least not for the moment

makes sense?

Anyway, that’s not my issue

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

But I think I found a solution for javascript

using lexical scope

instead of (js/eval exp)

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

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

and it works fine!!!!

👏😎👌

do you follow me?

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?

exactly

now I’d like to go one step further

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

But I don’t want to override all of them

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

Then I’d need to override only one function

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

perhaps not, checking

i bet it varies from browser to browser

yeah, not sure how to see that