Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit 90621f4

Browse files
authored
Merge pull request #63 from kephale/master
Clojure example
2 parents dbd866a + 51ef35c commit 90621f4

File tree

1 file changed

+46
-10
lines changed

1 file changed

+46
-10
lines changed

notebooks/Polyglot.ipynb

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -262,23 +262,59 @@
262262
]
263263
},
264264
{
265-
"cell_type": "markdown",
265+
"cell_type": "code",
266+
"execution_count": 2,
266267
"metadata": {},
268+
"outputs": [
269+
{
270+
"name": "stdout",
271+
"output_type": "stream",
272+
"text": [
273+
"{:major 1, :minor 8, :incremental 0, :qualifier nil}\n"
274+
]
275+
},
276+
{
277+
"data": {
278+
"text/plain": [
279+
"No Outputs"
280+
]
281+
},
282+
"execution_count": 2,
283+
"metadata": {},
284+
"output_type": "execute_result"
285+
}
286+
],
267287
"source": [
268288
"#!clojure\n",
269-
"(clojure-version)"
289+
"(println *clojure-version*)"
270290
]
271291
},
272292
{
273-
"cell_type": "markdown",
293+
"cell_type": "code",
294+
"execution_count": 14,
274295
"metadata": {},
296+
"outputs": [
297+
{
298+
"name": "stdout",
299+
"output_type": "stream",
300+
"text": [
301+
"[3 -1 2 1/2]\n"
302+
]
303+
},
304+
{
305+
"data": {
306+
"text/plain": [
307+
"No Outputs"
308+
]
309+
},
310+
"execution_count": 14,
311+
"metadata": {},
312+
"output_type": "execute_result"
313+
}
314+
],
275315
"source": [
276-
"(defmacro unless [test then]\n",
277-
" \"Evaluates then when test evaluates to be falsey\"\n",
278-
" (list 'if (list 'not test)\n",
279-
" then))\n",
280-
" \n",
281-
"(unless false (println \"false!!\"))"
316+
"(let [fn-list [+ - * /]]\n",
317+
" (println ((apply juxt fn-list) 1 2)))\n"
282318
]
283319
},
284320
{
@@ -456,7 +492,7 @@
456492
],
457493
"metadata": {
458494
"kernelspec": {
459-
"display_name": "Scijava",
495+
"display_name": "SciJava",
460496
"language": "groovy",
461497
"name": "scijava"
462498
},

0 commit comments

Comments
 (0)