Fork me on GitHub
#klipse
<
2016-11-19
>
practicalli-johnny18:11:54

@viebel has something changed that stops commented code being shown in klipse code sections ?

Yehonathan Sharvit18:11:21

I’m automatically removing the comments from last lines

practicalli-johnny18:11:23

I have several expressions as separate lines of code that I would like to group together in one klipse code section.

Yehonathan Sharvit18:11:32

is that causing you troubles?

practicalli-johnny18:11:54

I have been doing the following

<pre><code class="language-klipse" data-eval-context="expr">
(= 1 1)
;; (= "Hello" "Clojure")
;; (< 3 4)
;; (> 3 4)
;; (odd? 3)
;; (even? 7)
</code></pre>

practicalli-johnny18:11:25

Is it possible to now show the output of all these expressions ?

practicalli-johnny18:11:39

I can always create a section for each one...

practicalli-johnny18:11:01

I guess I can put the uncommented code last 🙂

Yehonathan Sharvit18:11:13

yeah - that will do it

Yehonathan Sharvit18:11:24

but anyway, I’m curious about your use case

Yehonathan Sharvit18:11:33

why do you need all those comments?

practicalli-johnny18:11:55

If I had more than one expression, I was only getting one result. I will try it again without comments..

Yehonathan Sharvit18:11:41

you are getting one expression because of data-eval-context=”expr"

Yehonathan Sharvit18:11:53

the workaround is to put the expressions in an array

Yehonathan Sharvit18:11:06

But i think the best is to have separate snippets

Yehonathan Sharvit18:11:19

with a introductory text for each snippet

practicalli-johnny18:11:49

I was showing different examples of conditions, so there wouldnt be any other text for each snippet... hence the idea to put them into one. I guess I could get students to copy/paste them into klipse

practicalli-johnny18:11:14

rather than have 6 snippet boxes...

Yehonathan Sharvit18:11:27

try to put all of them in an array

practicalli-johnny18:11:47

this is before introducing arrays 😞

Yehonathan Sharvit18:11:29

why not having several snippets?

Yehonathan Sharvit18:11:58

then you’ll have a direct connection between source code and its evaluation

practicalli-johnny18:11:36

Septerate snippets would take up a lot of space on the page... I think copy / paste from some examples into a klipse box would work well and would allow the students to guess if something was true or false before they pasted it...