Basic: fix errors, reader, if form. Self-host 0-3
[jackhill/mal.git] / basic / step8_macros.in.bas
1 REM POKE 1, PEEK(1)AND248: REM enable all ROM areas as RAM
2 REM POKE 55,0: POKE 56,192: CLR: REM move BASIC end from $A000 to $C000
3 GOTO MAIN
4
5 REM $INCLUDE: 'readline.in.bas'
6 REM $INCLUDE: 'types.in.bas'
7 REM $INCLUDE: 'reader.in.bas'
8 REM $INCLUDE: 'printer.in.bas'
9 REM $INCLUDE: 'env.in.bas'
10 REM $INCLUDE: 'core.in.bas'
11
12 REM $INCLUDE: 'debug.in.bas'
13
14 REM READ(A$) -> R
15 MAL_READ:
16 GOSUB READ_STR
17 RETURN
18
19 REM QUASIQUOTE(A) -> R
20 SUB QUASIQUOTE
21 REM pair?
22 IF (Z%(A,0)AND31)<6 OR (Z%(A,0)AND31)>7 THEN GOTO QQ_QUOTE
23 IF (Z%(A,1)=0) THEN GOTO QQ_QUOTE
24 GOTO QQ_UNQUOTE
25
26 QQ_QUOTE:
27 REM ['quote, ast]
28 AS$="quote":T=5:GOSUB STRING
29 B2=R:B1=A:GOSUB LIST2
30 AY=B2:GOSUB RELEASE
31
32 GOTO QQ_DONE
33
34 QQ_UNQUOTE:
35 R=A+1:GOSUB DEREF_R
36 IF (Z%(R,0)AND31)<>5 THEN GOTO QQ_SPLICE_UNQUOTE
37 IF S$(Z%(R,1))<>"unquote" THEN GOTO QQ_SPLICE_UNQUOTE
38 REM [ast[1]]
39 R=Z%(A,1)+1:GOSUB DEREF_R
40 Z%(R,0)=Z%(R,0)+32
41
42 GOTO QQ_DONE
43
44 QQ_SPLICE_UNQUOTE:
45 REM push A on the stack
46 X=X+1:X%(X)=A
47 REM rest of cases call quasiquote on ast[1..]
48 A=Z%(A,1):CALL QUASIQUOTE
49 T6=R
50 REM pop A off the stack
51 A=X%(X):X=X-1
52
53 REM set A to ast[0] for last two cases
54 A=A+1:GOSUB DEREF_A
55
56 REM pair?
57 IF (Z%(A,0)AND31)<6 OR (Z%(A,0)AND31)>7 THEN GOTO QQ_DEFAULT
58 IF (Z%(A,1)=0) THEN GOTO QQ_DEFAULT
59
60 B=A+1:GOSUB DEREF_B
61 IF (Z%(B,0)AND31)<>5 THEN GOTO QQ_DEFAULT
62 IF S$(Z%(B,1))<>"splice-unquote" THEN QQ_DEFAULT
63 REM ['concat, ast[0][1], quasiquote(ast[1..])]
64
65 B=Z%(A,1)+1:GOSUB DEREF_B:B2=B
66 AS$="concat":T=5:GOSUB STRING:B3=R
67 B1=T6:GOSUB LIST3
68 REM release inner quasiquoted since outer list takes ownership
69 AY=B1:GOSUB RELEASE
70 AY=B3:GOSUB RELEASE
71 GOTO QQ_DONE
72
73 QQ_DEFAULT:
74 REM ['cons, quasiquote(ast[0]), quasiquote(ast[1..])]
75
76 REM push T6 on the stack
77 X=X+1:X%(X)=T6
78 REM A set above to ast[0]
79 CALL QUASIQUOTE
80 B2=R
81 REM pop T6 off the stack
82 T6=X%(X):X=X-1
83
84 AS$="cons":T=5:GOSUB STRING:B3=R
85 B1=T6:GOSUB LIST3
86 REM release inner quasiquoted since outer list takes ownership
87 AY=B1:GOSUB RELEASE
88 AY=B2:GOSUB RELEASE
89 AY=B3:GOSUB RELEASE
90 QQ_DONE:
91 END SUB
92
93 REM MACROEXPAND(A, E) -> A:
94 SUB MACROEXPAND
95 REM push original A
96 X=X+1:X%(X)=A
97
98 MACROEXPAND_LOOP:
99 REM list?
100 IF (Z%(A,0)AND31)<>6 THEN GOTO MACROEXPAND_DONE
101 REM non-empty?
102 IF Z%(A,1)=0 THEN GOTO MACROEXPAND_DONE
103 B=A+1:GOSUB DEREF_B
104 REM symbol? in first position
105 IF (Z%(B,0)AND31)<>5 THEN GOTO MACROEXPAND_DONE
106 REM defined in environment?
107 K=B:CALL ENV_FIND
108 IF R=-1 THEN GOTO MACROEXPAND_DONE
109 B=T4:GOSUB DEREF_B
110 REM macro?
111 IF (Z%(B,0)AND31)<>11 THEN GOTO MACROEXPAND_DONE
112
113 F=B:AR=Z%(A,1):CALL APPLY
114 A=R
115
116 AY=X%(X)
117 REM if previous A was not the first A into macroexpand (i.e. an
118 REM intermediate form) then free it
119 IF A<>AY THEN Y=Y+1:Y%(Y,0)=A:Y%(Y,1)=LV
120
121 IF ER<>-2 THEN GOTO MACROEXPAND_DONE
122 GOTO MACROEXPAND_LOOP
123
124 MACROEXPAND_DONE:
125 X=X-1: REM pop original A
126 END SUB
127
128 REM EVAL_AST(A, E) -> R
129 SUB EVAL_AST
130 REM push A and E on the stack
131 X=X+2:X%(X-1)=E:X%(X)=A
132
133 IF ER<>-2 THEN GOTO EVAL_AST_RETURN
134
135 GOSUB DEREF_A
136
137 T=Z%(A,0)AND31
138 IF T=5 THEN GOTO EVAL_AST_SYMBOL
139 IF T>=6 AND T<=8 THEN GOTO EVAL_AST_SEQ
140
141 REM scalar: deref to actual value and inc ref cnt
142 R=A:GOSUB DEREF_R
143 Z%(R,0)=Z%(R,0)+32
144 GOTO EVAL_AST_RETURN
145
146 EVAL_AST_SYMBOL:
147 K=A:GOTO ENV_GET
148 ENV_GET_RETURN:
149 GOTO EVAL_AST_RETURN
150
151 EVAL_AST_SEQ:
152 REM allocate the first entry (T already set above)
153 L=0:N=0:GOSUB ALLOC
154
155 REM make space on the stack
156 X=X+4
157 REM push type of sequence
158 X%(X-3)=T
159 REM push sequence index
160 X%(X-2)=-1
161 REM push future return value (new sequence)
162 X%(X-1)=R
163 REM push previous new sequence entry
164 X%(X)=R
165
166 EVAL_AST_SEQ_LOOP:
167 REM update index
168 X%(X-2)=X%(X-2)+1
169
170 REM check if we are done evaluating the source sequence
171 IF Z%(A,1)=0 THEN GOTO EVAL_AST_SEQ_LOOP_DONE
172
173 REM if we are returning to DO, then skip last element
174 IF X%(X-6)=2 AND Z%(Z%(A,1),1)=0 THEN GOTO EVAL_AST_SEQ_LOOP_DONE
175
176 REM if hashmap, skip eval of even entries (keys)
177 IF (X%(X-3)=8) AND ((X%(X-2)AND1)=0) THEN GOTO EVAL_AST_DO_REF
178 GOTO EVAL_AST_DO_EVAL
179
180 EVAL_AST_DO_REF:
181 R=A+1:GOSUB DEREF_R: REM deref to target of referred entry
182 Z%(R,0)=Z%(R,0)+32: REM inc ref cnt of referred value
183 GOTO EVAL_AST_ADD_VALUE
184
185 EVAL_AST_DO_EVAL:
186 REM call EVAL for each entry
187 A=A+1:CALL EVAL
188 A=A-1
189 GOSUB DEREF_R: REM deref to target of evaluated entry
190
191 EVAL_AST_ADD_VALUE:
192
193 REM update previous value pointer to evaluated entry
194 Z%(X%(X)+1,1)=R
195
196 IF ER<>-2 THEN GOTO EVAL_AST_SEQ_LOOP_DONE
197
198 REM allocate the next entry
199 REM same new sequence entry type
200 T=X%(X-3):L=0:N=0:GOSUB ALLOC
201
202 REM update previous sequence entry value to point to new entry
203 Z%(X%(X),1)=R
204 REM update previous ptr to current entry
205 X%(X)=R
206
207 REM process the next sequence entry from source list
208 A=Z%(A,1)
209
210 GOTO EVAL_AST_SEQ_LOOP
211 EVAL_AST_SEQ_LOOP_DONE:
212 REM if no error, get return value (new seq)
213 IF ER=-2 THEN R=X%(X-1)
214 REM otherwise, free the return value and return nil
215 IF ER<>-2 THEN R=0:AY=X%(X-1):GOSUB RELEASE
216
217 REM pop previous, return, index and type
218 X=X-4
219 GOTO EVAL_AST_RETURN
220
221 EVAL_AST_RETURN:
222 REM pop A and E off the stack
223 E=X%(X-1):A=X%(X):X=X-2
224 END SUB
225
226 REM EVAL(A, E) -> R
227 SUB EVAL
228 LV=LV+1: REM track basic return stack level
229
230 REM push A and E on the stack
231 X=X+2:X%(X-1)=E:X%(X)=A
232
233 REM PRINT "EVAL A:"+STR$(A)+",X:"+STR$(X)+",LV:"+STR$(LV)+",FRE:"+STR$(FRE(0))
234
235 EVAL_TCO_RECUR:
236
237 IF ER<>-2 THEN GOTO EVAL_RETURN
238
239 REM AZ=A:PR=1:GOSUB PR_STR
240 REM PRINT "EVAL: "+R$+" [A:"+STR$(A)+", LV:"+STR$(LV)+"]"
241
242 GOSUB DEREF_A
243
244 GOSUB LIST_Q
245 IF R THEN GOTO APPLY_LIST
246 EVAL_NOT_LIST:
247 REM ELSE
248 CALL EVAL_AST
249 GOTO EVAL_RETURN
250
251 APPLY_LIST:
252 CALL MACROEXPAND
253
254 GOSUB LIST_Q
255 IF R<>1 THEN GOTO EVAL_NOT_LIST
256
257 GOSUB EMPTY_Q
258 IF R THEN R=A:Z%(R,0)=Z%(R,0)+32:GOTO EVAL_RETURN
259
260 A0=A+1
261 R=A0:GOSUB DEREF_R:A0=R
262
263 REM get symbol in A$
264 IF (Z%(A0,0)AND31)<>5 THEN A$=""
265 IF (Z%(A0,0)AND31)=5 THEN A$=S$(Z%(A0,1))
266
267 IF A$="def!" THEN GOTO EVAL_DEF
268 IF A$="let*" THEN GOTO EVAL_LET
269 IF A$="quote" THEN GOTO EVAL_QUOTE
270 IF A$="quasiquote" THEN GOTO EVAL_QUASIQUOTE
271 IF A$="defmacro!" THEN GOTO EVAL_DEFMACRO
272 IF A$="macroexpand" THEN GOTO EVAL_MACROEXPAND
273 IF A$="do" THEN GOTO EVAL_DO
274 IF A$="if" THEN GOTO EVAL_IF
275 IF A$="fn*" THEN GOTO EVAL_FN
276 GOTO EVAL_INVOKE
277
278 EVAL_GET_A3:
279 A3=Z%(Z%(Z%(A,1),1),1)+1
280 R=A3:GOSUB DEREF_R:A3=R
281 EVAL_GET_A2:
282 A2=Z%(Z%(A,1),1)+1
283 R=A2:GOSUB DEREF_R:A2=R
284 EVAL_GET_A1:
285 A1=Z%(A,1)+1
286 R=A1:GOSUB DEREF_R:A1=R
287 RETURN
288
289 EVAL_DEF:
290 REM PRINT "def!"
291 GOSUB EVAL_GET_A2: REM set A1 and A2
292
293 X=X+1:X%(X)=A1: REM push A1
294 A=A2:CALL EVAL: REM eval a2
295 A1=X%(X):X=X-1: REM pop A1
296
297 IF ER<>-2 THEN GOTO EVAL_RETURN
298
299 REM set a1 in env to a2
300 K=A1:V=R:GOSUB ENV_SET
301 GOTO EVAL_RETURN
302
303 EVAL_LET:
304 REM PRINT "let*"
305 GOSUB EVAL_GET_A2: REM set A1 and A2
306
307 X=X+1:X%(X)=A2: REM push/save A2
308 X=X+1:X%(X)=E: REM push env for for later release
309
310 REM create new environment with outer as current environment
311 O=E:GOSUB ENV_NEW
312 E=R
313 EVAL_LET_LOOP:
314 IF Z%(A1,1)=0 THEN GOTO EVAL_LET_LOOP_DONE
315
316 X=X+1:X%(X)=A1: REM push A1
317 REM eval current A1 odd element
318 A=Z%(A1,1)+1:CALL EVAL
319 A1=X%(X):X=X-1: REM pop A1
320
321 IF ER<>-2 THEN GOTO EVAL_LET_LOOP_DONE
322
323 REM set environment: even A1 key to odd A1 eval'd above
324 K=A1+1:V=R:GOSUB ENV_SET
325 AY=R:GOSUB RELEASE: REM release our use, ENV_SET took ownership
326
327 REM skip to the next pair of A1 elements
328 A1=Z%(Z%(A1,1),1)
329 GOTO EVAL_LET_LOOP
330
331 EVAL_LET_LOOP_DONE:
332 E4=X%(X):X=X-1: REM pop previous env
333
334 REM release previous environment if not the current EVAL env
335 IF E4<>X%(X-2) THEN AY=E4:GOSUB RELEASE
336
337 A2=X%(X):X=X-1: REM pop A2
338 A=A2:GOTO EVAL_TCO_RECUR: REM TCO loop
339
340 EVAL_DO:
341 A=Z%(A,1): REM rest
342 X=X+1:X%(X)=A: REM push/save A
343
344 CALL EVAL_AST
345
346 REM cleanup
347 AY=R: REM get eval'd list for release
348
349 A=X%(X):X=X-1: REM pop/restore original A for LAST
350 GOSUB LAST: REM get last element for return
351 A=R: REM new recur AST
352
353 REM cleanup
354 GOSUB RELEASE: REM release eval'd list
355 AY=A:GOSUB RELEASE: REM release LAST value (not sure why)
356
357 GOTO EVAL_TCO_RECUR: REM TCO loop
358
359 EVAL_QUOTE:
360 R=Z%(A,1)+1:GOSUB DEREF_R
361 Z%(R,0)=Z%(R,0)+32
362 GOTO EVAL_RETURN
363
364 EVAL_QUASIQUOTE:
365 R=Z%(A,1)+1:GOSUB DEREF_R
366 A=R:CALL QUASIQUOTE
367 REM add quasiquote result to pending release queue to free when
368 REM next lower EVAL level returns (LV)
369 Y=Y+1:Y%(Y,0)=R:Y%(Y,1)=LV
370
371 A=R:GOTO EVAL_TCO_RECUR: REM TCO loop
372
373 EVAL_DEFMACRO:
374 REM PRINT "defmacro!"
375 GOSUB EVAL_GET_A2: REM set A1 and A2
376
377 X=X+1:X%(X)=A1: REM push A1
378 A=A2:CALL EVAL: REM eval A2
379 A1=X%(X):X=X-1: REM pop A1
380
381 REM change function to macro
382 Z%(R,0)=Z%(R,0)+1
383
384 REM set A1 in env to A2
385 K=A1:V=R:GOSUB ENV_SET
386 GOTO EVAL_RETURN
387
388 EVAL_MACROEXPAND:
389 REM PRINT "macroexpand"
390 R=Z%(A,1)+1:GOSUB DEREF_R
391 A=R:CALL MACROEXPAND
392 R=A
393
394 REM since we are returning it unevaluated, inc the ref cnt
395 Z%(R,0)=Z%(R,0)+32
396 GOTO EVAL_RETURN
397
398 EVAL_IF:
399 GOSUB EVAL_GET_A1: REM set A1
400 REM push A
401 X=X+1:X%(X)=A
402 A=A1:CALL EVAL
403 REM pop A
404 A=X%(X):X=X-1
405 IF (R=0) OR (R=1) THEN GOTO EVAL_IF_FALSE
406
407 EVAL_IF_TRUE:
408 AY=R:GOSUB RELEASE
409 GOSUB EVAL_GET_A2: REM set A1 and A2 after EVAL
410 A=A2:GOTO EVAL_TCO_RECUR: REM TCO loop
411 EVAL_IF_FALSE:
412 AY=R:GOSUB RELEASE
413 REM if no false case (A3), return nil
414 B=A:GOSUB COUNT
415 IF R<4 THEN R=0:GOTO EVAL_RETURN
416 GOSUB EVAL_GET_A3: REM set A1 - A3 after EVAL
417 A=A3:GOTO EVAL_TCO_RECUR: REM TCO loop
418
419 EVAL_FN:
420 GOSUB EVAL_GET_A2: REM set A1 and A2
421 A=A2:P=A1:GOSUB MAL_FUNCTION
422 GOTO EVAL_RETURN
423
424 EVAL_INVOKE:
425 CALL EVAL_AST
426
427 REM if error, return f/args for release by caller
428 IF ER<>-2 THEN GOTO EVAL_RETURN
429
430 REM push f/args for release after call
431 X=X+1:X%(X)=R
432
433 F=R+1
434
435 AR=Z%(R,1): REM rest
436 R=F:GOSUB DEREF_R:F=R
437
438 REM if metadata, get the actual object
439 IF (Z%(F,0)AND31)>=16 THEN F=Z%(F,1)
440
441 IF (Z%(F,0)AND31)=9 THEN GOTO EVAL_DO_FUNCTION
442 IF (Z%(F,0)AND31)=10 THEN GOTO EVAL_DO_MAL_FUNCTION
443
444 REM if error, pop and return f/args for release by caller
445 R=X%(X):X=X-1
446 ER=-1:ER$="apply of non-function":GOTO EVAL_RETURN
447
448 EVAL_DO_FUNCTION:
449 REM regular function
450 IF Z%(F,1)<60 THEN GOSUB DO_FUNCTION:GOTO EVAL_DO_FUNCTION_SKIP
451 REM for recur functions (apply, map, swap!), use GOTO
452 IF Z%(F,1)>60 THEN CALL DO_TCO_FUNCTION
453 EVAL_DO_FUNCTION_SKIP:
454
455 REM pop and release f/args
456 AY=X%(X):X=X-1:GOSUB RELEASE
457 GOTO EVAL_RETURN
458
459 EVAL_DO_MAL_FUNCTION:
460 E4=E: REM save the current environment for release
461
462 REM create new environ using env stored with function
463 O=Z%(F+1,1):BI=Z%(F+1,0):EX=AR:GOSUB ENV_NEW_BINDS
464
465 REM release previous env if it is not the top one on the
466 REM stack (X%(X-2)) because our new env refers to it and
467 REM we no longer need to track it (since we are TCO recurring)
468 IF E4<>X%(X-2) THEN AY=E4:GOSUB RELEASE
469
470 REM claim the AST before releasing the list containing it
471 A=Z%(F,1):Z%(A,0)=Z%(A,0)+32
472 REM add AST to pending release queue to free as soon as EVAL
473 REM actually returns (LV+1)
474 Y=Y+1:Y%(Y,0)=A:Y%(Y,1)=LV+1
475
476 REM pop and release f/args
477 AY=X%(X):X=X-1:GOSUB RELEASE
478
479 REM A set above
480 E=R:GOTO EVAL_TCO_RECUR: REM TCO loop
481
482 EVAL_RETURN:
483 REM AZ=R: PR=1: GOSUB PR_STR
484 REM PRINT "EVAL_RETURN R: ["+R$+"] ("+STR$(R)+"), LV:"+STR$(LV)+",ER:"+STR$(ER)
485
486 REM release environment if not the top one on the stack
487 IF E<>X%(X-1) THEN AY=E:GOSUB RELEASE
488
489 LV=LV-1: REM track basic return stack level
490
491 REM release everything we couldn't release earlier
492 GOSUB RELEASE_PEND
493
494 REM trigger GC
495 TA=FRE(0)
496
497 REM pop A and E off the stack
498 E=X%(X-1):A=X%(X):X=X-2
499
500 END SUB
501
502 REM PRINT(A) -> R$
503 MAL_PRINT:
504 AZ=A:PR=1:GOSUB PR_STR
505 RETURN
506
507 REM RE(A$) -> R
508 REM Assume D has repl_env
509 REM caller must release result
510 RE:
511 R1=0
512 GOSUB MAL_READ
513 R1=R
514 IF ER<>-2 THEN GOTO RE_DONE
515
516 A=R:E=D:CALL EVAL
517
518 RE_DONE:
519 REM Release memory from MAL_READ
520 IF R1<>0 THEN AY=R1:GOSUB RELEASE
521 RETURN: REM caller must release result of EVAL
522
523 REM REP(A$) -> R$
524 REM Assume D has repl_env
525 SUB REP
526 R1=0:R2=0
527 GOSUB MAL_READ
528 R1=R
529 IF ER<>-2 THEN GOTO REP_DONE
530
531 A=R:E=D:CALL EVAL
532 R2=R
533 IF ER<>-2 THEN GOTO REP_DONE
534
535 A=R:GOSUB MAL_PRINT
536 RT$=R$
537
538 REP_DONE:
539 REM Release memory from MAL_READ and EVAL
540 IF R2<>0 THEN AY=R2:GOSUB RELEASE
541 IF R1<>0 THEN AY=R1:GOSUB RELEASE
542 R$=RT$
543 END SUB
544
545 REM MAIN program
546 MAIN:
547 GOSUB INIT_MEMORY
548
549 LV=0
550
551 REM create repl_env
552 O=-1:GOSUB ENV_NEW:D=R
553
554 REM core.EXT: defined in Basic
555 E=D:GOSUB INIT_CORE_NS: REM set core functions in repl_env
556
557 ZT=ZI: REM top of memory after base repl_env
558
559 REM core.mal: defined using the language itself
560 A$="(def! not (fn* (a) (if a false true)))"
561 GOSUB RE:AY=R:GOSUB RELEASE
562
563 A$="(def! load-file (fn* (f) (eval (read-file f))))"
564 GOSUB RE:AY=R:GOSUB RELEASE
565
566 A$="(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs)"
567 A$=A$+" (if (> (count xs) 1) (nth xs 1) (throw "+CHR$(34)+"odd number of"
568 A$=A$+" forms to cond"+CHR$(34)+")) (cons 'cond (rest (rest xs)))))))"
569 GOSUB RE:AY=R:GOSUB RELEASE
570
571 A$="(defmacro! or (fn* (& xs) (if (empty? xs) nil (if (= 1 (count xs)) (first xs)"
572 A$=A$+" `(let* (or_FIXME ~(first xs)) (if or_FIXME or_FIXME (or ~@(rest xs))))))))"
573 GOSUB RE:AY=R:GOSUB RELEASE
574
575 REM load the args file
576 A$="(def! -*ARGS*- (load-file "+CHR$(34)+".args.mal"+CHR$(34)+"))"
577 GOSUB RE:AY=R:GOSUB RELEASE
578
579 REM set the argument list
580 A$="(def! *ARGV* (rest -*ARGS*-))"
581 GOSUB RE:AY=R:GOSUB RELEASE
582
583 REM get the first argument
584 A$="(first -*ARGS*-)"
585 GOSUB RE
586
587 REM if there is an argument, then run it as a program
588 IF R<>0 THEN AY=R:GOSUB RELEASE:GOTO RUN_PROG
589 REM no arguments, start REPL loop
590 IF R=0 THEN GOTO REPL_LOOP
591
592 RUN_PROG:
593 REM run a single mal program and exit
594 A$="(load-file (first -*ARGS*-))"
595 GOSUB RE
596 IF ER<>-2 THEN GOSUB PRINT_ERROR
597 GOTO QUIT
598
599 REPL_LOOP:
600 A$="user> ":GOSUB READLINE: REM call input parser
601 IF EOF=1 THEN GOTO QUIT
602
603 A$=R$:CALL REP: REM call REP
604
605 IF ER<>-2 THEN GOSUB PRINT_ERROR:GOTO REPL_LOOP
606 PRINT R$
607 GOTO REPL_LOOP
608
609 QUIT:
610 REM P1=ZT: P2=-1: GOSUB PR_MEMORY
611 GOSUB PR_MEMORY_SUMMARY
612 END
613
614 PRINT_ERROR:
615 PRINT "Error: "+ER$
616 ER=-2:ER$=""
617 RETURN
618