Fork me on GitHub
#klipse
<
2016-10-27
>
jrheard16:10:23

@viebel - is it possible to have klipse plugin snippets (is there a word for these?) run inside of another, surrounding expression?

jrheard16:10:27

this isn’t necessary, i’m just curious

jrheard16:10:47

eg i’m thinking about a blog post where there are 5-6 snippets, each of which ends with a call to (draw-grid a-grid)

jrheard16:10:10

and i’m going to supply draw-grid offscreen, in a visibility:hidden snippet, because its implementation details are off-topic; the blog post is about grids, not the html5 canvas

jrheard16:10:42

and so the idea would be that each snippet has a <canvas> immediately under it, and each snippet’s call to draw-grid draws to that specific canvas

jrheard16:10:04

i can accomplish this by just having this utility function have an API like (draw-grid a-grid :canvas-1), but i wanted to make sure there isn’t a way to eg have some code run offscreen that makes a snippet run in a (binding [*which-canvas* :canvas-1]) expression, so the draw-grid call can just look like (draw-grid a-grid) and the user doesn’t have to even think about what’s going on

Yehonathan Sharvit17:10:02

klippet - klipset - snipperactive - what else? @jrheard

Yehonathan Sharvit17:10:31

@mfikes do you have a good idea for of name to the klipse interactive snippets ?

jrheard17:10:58

“klipse snippet” works just fine for me tbh

jrheard17:10:11

just wanted to see if there’s already a different preexisting vocabulary word for ‘em 🙂

Yehonathan Sharvit17:10:12

I’m trying to think about your question re: wrapping snippets

jrheard17:10:54

i think “no” would be a totally fine answer to my question 😄

jrheard17:10:00

it could be a super bad idea

Yehonathan Sharvit17:10:26

another way of achieving almost the same result would be to let each snippet provide a “pre-run” piece of code

Yehonathan Sharvit17:10:41

via some html attribute like data-pre-run

jrheard17:10:49

yeah, like setting a canvas-id atom to “canvas-2"

jrheard17:10:56

that would work great for this situation for sure

Yehonathan Sharvit17:10:16

Would you like to make a PR?

jrheard17:10:44

sure why not - will take a look this afternoon

jrheard17:10:06

cat is sleeping on one hand atm

Yehonathan Sharvit17:10:26

don’t hesitate to send me questions

Yehonathan Sharvit17:10:37

but keep in mind that I’m in UTC+2

Yehonathan Sharvit17:10:54

so, don’t be upset if I’m not responsive on slack

Yehonathan Sharvit17:10:03

it’s ok to send messages 24/7

Yehonathan Sharvit19:10:20

test.check documentation with klipse will look like this