Skip to content

Commit

Permalink
update ipynb examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaSd committed Jul 27, 2024
1 parent 1345c7e commit c56511f
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 55 deletions.
14 changes: 10 additions & 4 deletions crates/irust_repl/irust_kernel/evcxr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "2ed08531-0851-4cd0-97c8-a11f70058136",
"metadata": {
"tags": []
"tags": [],
"vscode": {
"languageId": "rust"
}
},
"outputs": [],
"source": [
Expand All @@ -17,7 +20,10 @@
"execution_count": 4,
"id": "798a5e69-b290-4f26-a711-f28fafa4dab8",
"metadata": {
"tags": []
"tags": [],
"vscode": {
"languageId": "rust"
}
},
"outputs": [
{
Expand Down Expand Up @@ -319,7 +325,7 @@
"metadata": {
"kernelspec": {
"display_name": "IRust",
"language": "bash",
"language": "rust",
"name": "irust"
},
"language_info": {
Expand Down
149 changes: 98 additions & 51 deletions crates/irust_repl/irust_kernel/irust.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "590f518b-4353-45e8-ae65-355db93810a2",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"9\n"
]
"data": {
"text/plain": [
"9"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
Expand All @@ -20,26 +26,36 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "926722e2-df56-4547-adf3-916ec5bc2c50",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [],
"source": [
"let a = \"hello\";"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"id": "dae7e4f4-1c40-448c-af79-bf9497e5294b",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Chars(['h', 'e', 'l', 'l', 'o'])\n"
]
"data": {
"text/plain": [
"Chars(['h', 'e', 'l', 'l', 'o'])"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
Expand All @@ -48,26 +64,36 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"id": "b25222a2-c755-4d5a-b5c5-21dc4c65e7f8",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [],
"source": [
":add regex"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 5,
"id": "c2c8b56a-e2d1-42a0-8572-3d0d1503c7ab",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"true\n"
]
"data": {
"text/plain": [
"true"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
Expand All @@ -76,47 +102,68 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 6,
"id": "c658b87b-7a97-44a6-ac6f-7eb47243bdd4",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[0m\u001b[0m\u001b[1m\u001b[36m Blocking\u001b[0m waiting for file lock on build directory\n",
"\u001b[0m\u001b[0m\u001b[1m\u001b[32m Compiling\u001b[0m irust_host_repl v0.1.0 (/tmp/irust_host_repl)\n",
"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0369]\u001b[0m\u001b[0m\u001b[1m: cannot add `{integer}` to `&str`\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:3:19\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n",
"\u001b[0m\u001b[1m\u001b[38;5;12m3\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0mlet a = \"hello\";a + 1\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m-\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m-\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m{integer}\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m&str\u001b[0m\n",
"\n",
"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to previous error\u001b[0m\n",
"\n",
"\u001b[0m\u001b[1mFor more information about this error, try `rustc --explain E0369`.\u001b[0m\n",
"\u001b[0m\u001b[0m\u001b[1m\u001b[31merror\u001b[0m\u001b[1m:\u001b[0m could not compile `irust_host_repl`\n",
"\n",
"To learn more, run the command again with --verbose.\n"
]
"data": {
"text/plain": [
"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0369]\u001b[0m\u001b[0m\u001b[1m: cannot add `{integer}` to `&str`\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:4:3\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n",
"\u001b[0m\u001b[1m\u001b[38;5;12m4\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0ma + 1\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m-\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m-\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m{integer}\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n",
"\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m&str\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"a + 1"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "0d15ad22",
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [
{
"data": {
"text/plain": [
"Ok(Regex(\"aze\"))"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"regex::Regex::new(\"aze\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "IRustKernel",
"language": "",
"name": "irustkernel"
"display_name": "IRust",
"language": "rust",
"name": "irust"
},
"language_info": {
"file_extension": ".rs",
"mimetype": "text/plain",
"mimetype": "text/x-rust",
"name": "IRust"
}
},
Expand Down

0 comments on commit c56511f

Please sign in to comment.