klipse

jrheard 2016-11-02T14:32:55.000370Z

@viebel - i’m awake!

Yehonathan Sharvit 2016-11-02T14:35:01.000371Z

Good morning @jrheard

Yehonathan Sharvit 2016-11-02T14:35:29.000372Z

Thanks a lot for your comments on https://github.com/viebel/klipse/pull/131

jrheard 2016-11-02T14:35:43.000374Z

np! basically the prompt just feels unpolished to me, and the codemirror output feels more polished - but it’s totally possible that i’m incorrect / crazy!

Yehonathan Sharvit 2016-11-02T14:36:05.000375Z

I don’t like the prompt at all from a ui perspective

jrheard 2016-11-02T14:36:14.000377Z

oh nice

Yehonathan Sharvit 2016-11-02T14:36:24.000378Z

But that’s the only trick I found to be able to synchronously query the user

Yehonathan Sharvit 2016-11-02T14:37:04.000379Z

And I think it’s important to allow the user to say - “don’t kill the loop"

jrheard 2016-11-02T14:37:09.000380Z

ah, gotcha

jrheard 2016-11-02T14:37:52.000381Z

yeah, i don’t think there’s another way to query the user in this context, so i guess it’s just down to whether or not it’s important to let them decide on whether or not to kill the loop

jrheard 2016-11-02T14:38:21.000382Z

personally, i think it’d be fine if we just always said “your thing took longer than X seconds so we killed it - try making it run faster!”, but i can see how that’s also a bad UI experience

jrheard 2016-11-02T14:38:23.000383Z

hm

jrheard 2016-11-02T14:39:04.000384Z

ok, well that’s a good point - i’m less opposed to the prompt than i was before 🙂

jrheard 2016-11-02T14:39:49.000385Z

we could also use (js/confirm) so they have yes/no buttons instead of having to type in “yes” or “no"

Yehonathan Sharvit 2016-11-02T14:40:13.000386Z

yeah

Yehonathan Sharvit 2016-11-02T14:40:41.000387Z

The reason I chose prompt is that I thought there might me - in the future - more than two options

Yehonathan Sharvit 2016-11-02T14:40:54.000388Z

maybe - store code in localStorage

jrheard 2016-11-02T14:40:55.000389Z

ah, interesting

Yehonathan Sharvit 2016-11-02T14:40:58.000390Z

or - refresh the page

Yehonathan Sharvit 2016-11-02T14:41:03.000391Z

or something else

jrheard 2016-11-02T14:42:12.000392Z

that makes sense! how do you feel about going with js/confirm for now, and switching to js/prompt in the future if there ends up being support for more options?

jrheard 2016-11-02T14:42:27.000393Z

(unless you plan on adding support for more options in this branch, in which case i think sticking with the prompt is fine!)

Yehonathan Sharvit 2016-11-02T14:44:01.000394Z

I’m 100% with you

1👍
Yehonathan Sharvit 2016-11-02T14:44:08.000395Z

it’s the essence of agility

Yehonathan Sharvit 2016-11-02T14:44:21.000396Z

don’t prepare for something that might never happen

Yehonathan Sharvit 2016-11-02T14:44:23.000397Z

I love it

jrheard 2016-11-02T14:44:24.000398Z

++

jrheard 2016-11-02T14:44:26.000399Z

😄

jrheard 2016-11-02T14:44:47.000400Z

it’s exciting that this feature is actually working!

jrheard 2016-11-02T14:44:56.000401Z

i didn’t think it’d be possible to fix it so quickly!

Yehonathan Sharvit 2016-11-02T14:45:08.000402Z

Yeah I am amazed too!

Yehonathan Sharvit 2016-11-02T14:45:20.000403Z

I thought about it a couple of weeks ago

Yehonathan Sharvit 2016-11-02T14:45:38.000404Z

I mean about the idea of preventing inf. loops

Yehonathan Sharvit 2016-11-02T14:45:55.000405Z

But I put it aside as I didn’t find any simple way of doing it

Yehonathan Sharvit 2016-11-02T14:46:13.000406Z

And then, a couple of days ago, you re-opened the discussion

Yehonathan Sharvit 2016-11-02T14:46:24.000407Z

And it made me think about it again

jrheard 2016-11-02T14:46:28.000408Z

nice!

Yehonathan Sharvit 2016-11-02T14:46:43.000409Z

Meanwhile, I have been much less afraid of looking at cljs.compiler code

Yehonathan Sharvit 2016-11-02T14:46:57.000410Z

This is how came to my mind the idea of overriding emit

Yehonathan Sharvit 2016-11-02T14:47:29.000411Z

BTW, do you think there is a better way to override emit - whithout copy/pasting the whole code?

Yehonathan Sharvit 2016-11-02T14:47:55.000412Z

I mean: print the guard() and then defer to the original emit

jrheard 2016-11-02T14:48:00.000413Z

i haven’t been able to think of anything 😕

jrheard 2016-11-02T14:48:06.000414Z

i agree that copy-pasting it doesn’t feel great

Yehonathan Sharvit 2016-11-02T14:48:18.000415Z

I tried to do

Yehonathan Sharvit 2016-11-02T14:48:24.000416Z

(def original-emit emit)

Yehonathan Sharvit 2016-11-02T14:48:35.000417Z

(defn my-emit
 (if .... (print “guard()”))
 (original-emit))

Yehonathan Sharvit 2016-11-02T14:49:08.000419Z

But it did not work at all

jrheard 2016-11-02T14:49:10.000420Z

did original-emit end up getting overriden later? maybe a defonce would help

jrheard 2016-11-02T14:49:29.000421Z

or was that not the issue?

Yehonathan Sharvit 2016-11-02T14:50:57.000422Z

Donna

Yehonathan Sharvit 2016-11-02T14:51:00.000423Z

Will check again

Yehonathan Sharvit 2016-11-02T14:51:04.000424Z

Something else

jrheard 2016-11-02T14:51:08.000425Z

coolcool

Yehonathan Sharvit 2016-11-02T14:51:30.000426Z

A new feature I want to add to klipse is to append a console box to each snippet

Yehonathan Sharvit 2016-11-02T14:51:51.000427Z

That will contain the output of the print statements inside the snippet

Yehonathan Sharvit 2016-11-02T14:51:54.000428Z

Waht do u think?

jrheard 2016-11-02T14:52:06.000429Z

sounds like a good idea to me!

jrheard 2016-11-02T14:52:40.000430Z

unless there’s a way to somehow prepend the output of those print statements to the preexisting output console window..

jrheard 2016-11-02T14:53:02.000431Z

so it would magically look like:

;; foo
;; bar
[1 2 3 4]

jrheard 2016-11-02T14:53:08.000432Z

not sure if that’s feasible

jrheard 2016-11-02T14:53:50.000433Z

maybe you wouldn’t even need to prepend them, you could just interleave them like

;; foo
[1 2 3 4]
;; bar
depending on when things got printed, etc

jrheard 2016-11-02T14:53:57.000434Z

anyway, your call - i think that either approach (new console output window, reusing preexisting output window) is fine!

Yehonathan Sharvit 2016-11-02T14:54:44.000436Z

I don’t understand what u mean by “the preexisting output console window”?

jrheard 2016-11-02T14:55:05.000437Z

sorry, cat is interfering

jrheard 2016-11-02T14:55:25.000438Z

i mean that right now, klipse snippets have two windows, the input codemirror window and the output codemirror window; and it sounds like you’re planning on adding a third window

jrheard 2016-11-02T14:55:44.000439Z

i was suggesting using the output codemirror window instead of adding a third window; but i don’t feel very strongly either way, i’m not sure which option is better than the other

jrheard 2016-11-02T14:56:07.000440Z

in the examples i gave above, the [1 2 3 4] is what the codemirror output window would usually be showing

Yehonathan Sharvit 2016-11-02T14:56:15.000441Z

gotcha

Yehonathan Sharvit 2016-11-02T14:56:23.000442Z

I love your idea

Yehonathan Sharvit 2016-11-02T14:56:27.000443Z

much more than mine

jrheard 2016-11-02T14:56:31.000444Z

hee great!

jrheard 2016-11-02T14:57:08.000445Z

ok, breakfast time - thanks for chatting, all these features sound exciting!

Yehonathan Sharvit 2016-11-02T14:57:59.000446Z

I’m going to TAI-CHI

jrheard 2016-11-02T14:58:56.000447Z

nice!