Skip to content

Commit d83411c

Browse files
committed
lab7
1 parent 9ec30d1 commit d83411c

File tree

1 file changed

+30
-171
lines changed

1 file changed

+30
-171
lines changed

interactive_notebooks/lab7/lab7_empty.ipynb

Lines changed: 30 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -22,71 +22,27 @@
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": 1,
26-
"metadata": {},
27-
"outputs": [
28-
{
29-
"data": {
30-
"text/plain": [
31-
"1"
32-
]
33-
},
34-
"metadata": {},
35-
"output_type": "display_data"
36-
}
37-
],
25+
"execution_count": null,
26+
"metadata": {},
27+
"outputs": [],
3828
"source": [
3929
"x = 1"
4030
]
4131
},
4232
{
4333
"cell_type": "code",
44-
"execution_count": 2,
45-
"metadata": {},
46-
"outputs": [
47-
{
48-
"name": "stdout",
49-
"output_type": "stream",
50-
"text": [
51-
"x + 1 = 2\n"
52-
]
53-
},
54-
{
55-
"data": {
56-
"text/plain": [
57-
"2"
58-
]
59-
},
60-
"metadata": {},
61-
"output_type": "display_data"
62-
}
63-
],
34+
"execution_count": null,
35+
"metadata": {},
36+
"outputs": [],
6437
"source": [
6538
"@show x + 1 "
6639
]
6740
},
6841
{
6942
"cell_type": "code",
70-
"execution_count": 3,
71-
"metadata": {},
72-
"outputs": [
73-
{
74-
"name": "stdout",
75-
"output_type": "stream",
76-
"text": [
77-
"x + 1 = 2\n"
78-
]
79-
},
80-
{
81-
"data": {
82-
"text/plain": [
83-
"2"
84-
]
85-
},
86-
"metadata": {},
87-
"output_type": "display_data"
88-
}
89-
],
43+
"execution_count": null,
44+
"metadata": {},
45+
"outputs": [],
9046
"source": [
9147
"let y = x + 1 # creates a temporary local variable\n",
9248
" println(\"x + 1 = \", y)\n",
@@ -96,53 +52,19 @@
9652
},
9753
{
9854
"cell_type": "code",
99-
"execution_count": 4,
100-
"metadata": {},
101-
"outputs": [
102-
{
103-
"name": "stdout",
104-
"output_type": "stream",
105-
"text": [
106-
"x = 3 = 3\n"
107-
]
108-
},
109-
{
110-
"data": {
111-
"text/plain": [
112-
"3"
113-
]
114-
},
115-
"metadata": {},
116-
"output_type": "display_data"
117-
}
118-
],
55+
"execution_count": null,
56+
"metadata": {},
57+
"outputs": [],
11958
"source": [
12059
"# assignments should create the variable\n",
12160
"@show x = 3"
12261
]
12362
},
12463
{
12564
"cell_type": "code",
126-
"execution_count": 5,
127-
"metadata": {},
128-
"outputs": [
129-
{
130-
"name": "stdout",
131-
"output_type": "stream",
132-
"text": [
133-
"x = 2 = 2\n"
134-
]
135-
},
136-
{
137-
"data": {
138-
"text/plain": [
139-
"2"
140-
]
141-
},
142-
"metadata": {},
143-
"output_type": "display_data"
144-
}
145-
],
65+
"execution_count": null,
66+
"metadata": {},
67+
"outputs": [],
14668
"source": [
14769
"let y = x = 2 \n",
14870
" println(\"x = 2 = \", y)\n",
@@ -152,19 +74,9 @@
15274
},
15375
{
15476
"cell_type": "code",
155-
"execution_count": 6,
156-
"metadata": {},
157-
"outputs": [
158-
{
159-
"data": {
160-
"text/plain": [
161-
"2"
162-
]
163-
},
164-
"metadata": {},
165-
"output_type": "display_data"
166-
}
167-
],
77+
"execution_count": null,
78+
"metadata": {},
79+
"outputs": [],
16880
"source": [
16981
"x # should be equal to 2"
17082
]
@@ -178,19 +90,9 @@
17890
},
17991
{
18092
"cell_type": "code",
181-
"execution_count": 7,
182-
"metadata": {},
183-
"outputs": [
184-
{
185-
"data": {
186-
"text/plain": [
187-
"@myshow (macro with 1 method)"
188-
]
189-
},
190-
"metadata": {},
191-
"output_type": "display_data"
192-
}
193-
],
93+
"execution_count": null,
94+
"metadata": {},
95+
"outputs": [],
19496
"source": [
19597
"macro myshow(ex)\n",
19698
" quote\n",
@@ -209,26 +111,9 @@
209111
},
210112
{
211113
"cell_type": "code",
212-
"execution_count": 8,
213-
"metadata": {},
214-
"outputs": [
215-
{
216-
"name": "stdout",
217-
"output_type": "stream",
218-
"text": [
219-
"xx = 1 + 1 = 2\n"
220-
]
221-
},
222-
{
223-
"data": {
224-
"text/plain": [
225-
"2"
226-
]
227-
},
228-
"metadata": {},
229-
"output_type": "display_data"
230-
}
231-
],
114+
"execution_count": null,
115+
"metadata": {},
116+
"outputs": [],
232117
"source": [
233118
"@myshow xx = 1 + 1\n",
234119
"xx # should be defined"
@@ -249,25 +134,9 @@
249134
},
250135
{
251136
"cell_type": "code",
252-
"execution_count": 9,
253-
"metadata": {},
254-
"outputs": [
255-
{
256-
"data": {
257-
"text/plain": [
258-
"quote\n",
259-
" Base.println(\"x + 1 = \", Base.repr(begin\n",
260-
" \u001b[90m#= show.jl:1181 =#\u001b[39m\n",
261-
" local var\"#65#value\" = x + 1\n",
262-
" end))\n",
263-
" var\"#65#value\"\n",
264-
"end"
265-
]
266-
},
267-
"metadata": {},
268-
"output_type": "display_data"
269-
}
270-
],
137+
"execution_count": null,
138+
"metadata": {},
139+
"outputs": [],
271140
"source": [
272141
"@macroexpand @show x + 1"
273142
]
@@ -282,19 +151,9 @@
282151
},
283152
{
284153
"cell_type": "code",
285-
"execution_count": 10,
286-
"metadata": {},
287-
"outputs": [
288-
{
289-
"data": {
290-
"text/plain": [
291-
"run_polynomial (generic function with 1 method)"
292-
]
293-
},
294-
"metadata": {},
295-
"output_type": "display_data"
296-
}
297-
],
154+
"execution_count": null,
155+
"metadata": {},
156+
"outputs": [],
298157
"source": [
299158
"function run_polynomial(n, a, x)\n",
300159
" for _ in 1:n\n",

0 commit comments

Comments
 (0)