Skip to content

Instantly share code, notes, and snippets.

@robbielynch
Created April 11, 2014 15:31
Show Gist options
  • Save robbielynch/10478092 to your computer and use it in GitHub Desktop.
Save robbielynch/10478092 to your computer and use it in GitHub Desktop.
This is the first IErlang Notebook that I've created using my erlang language kernel backend for IPython. As it's the first prototype, some things work, some don't. The language key states it's python, but it's actually erlang... not sure why it hasn't changed to "erlang". Keep up to date with IErlang Notebook @ http://roblynch.info/category/ier…
{
"metadata": {
"name": "",
"signature": "sha256:5bcfb92c02773d33dd45462a40fd1012f4eb1a2bf0910015c3f65b0697a2556a"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Interactive Erlang Notebook\n",
">By *Robbie Lynch*\n",
"\n",
">Supervised by *Paul Barry*\n",
"\n",
">*Institute of Technology, Carlow, Ireland*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###Atoms"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"thisisanatom."
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"thisisanatom"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 1
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"'This is an atom with spaces'."
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"This is an atom with spaces"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 2
}
],
"prompt_number": 2
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"AtomVariable = 'atom variable'."
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"atom variable"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 3
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###Lists"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"MyList = [1,2,3,4,5]."
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"[1,2,3,4,5]"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 4
}
],
"prompt_number": 4
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"lists:sort([783, 4374, 3, 99, 399, 366, 2443, 44,1, 837])."
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"[1,3,44,99,366,399,783,837,2443,4374]"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 5
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###We can do some sums too.."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"9 + 9."
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"18"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 6
}
],
"prompt_number": 6
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"7 - 100."
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"-93"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 7
}
],
"prompt_number": 7
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"99 div 5."
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"19"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 8
}
],
"prompt_number": 8
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"987534985739485739485734 * 1082374928472394873298472394873294738478378748."
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"1068883109553763368499111204481655674344563041030379370486731594781032"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 9
}
],
"prompt_number": 9
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###What doesn't work?\n",
"\n",
"* Tuples, not sure why yet.\n",
"* Normal division e.g. 99 / 5.... because of json encoding error.\n",
"* List of lists of lists ouput\n",
"* Knowing when to output list of ints or a string\n",
"* Variable bindings. Cannot refer to previously assigned variables."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment