@@ -207,6 +207,7 @@ print
207207 %if (print-if +.stat)
208208 %for-range (print-for-range +.stat)
209209 %for-in (print-for-in +.stat)
210+ %function (print-function +.stat)
210211 ==
211212:: for-in
212213::
@@ -253,6 +254,55 @@ print
253254 (print-blok body.for-range)
254255 "\0aend"
255256 ==
257+:: function
258+::
259+++ print-function
260+ |= =function
261+ ^- tape
262+ %- zing
263+ :~
264+ "function "
265+ (print-funcname name.function)
266+ (print-funcbody body.function)
267+ ==
268+:: funcname
269+::
270+++ print-funcname
271+ |= =funcname
272+ ^- tape
273+ %- zing
274+ :~
275+ (dotted (turn nested.funcname trip))
276+ ::
277+ ?~ with-self.funcname ""
278+ %- zing ~[":" (trip u.with-self.funcname)]
279+ ==
280+:: funcbody
281+::
282+++ print-funcbody
283+ |= =funcbody
284+ ^- tape
285+ %- zing
286+ :~
287+ "("
288+ (print-parlist pars.funcbody)
289+ ")\0a"
290+ (print-blok body.funcbody)
291+ "\0aend"
292+ ==
293+:: parlist
294+::
295+++ print-parlist
296+ |= =parlist
297+ ^- tape
298+ %- zing
299+ :~
300+ (commaed (turn pars.parlist trip))
301+ ::
302+ ?. wildcard.parlist ""
303+ ?~ pars.parlist "..."
304+ ", ..."
305+ ==
256306:: if
257307::
258308++ print-if
@@ -359,6 +409,11 @@ print
359409 ^- tape
360410 %- zing
361411 %+ join "," l
412+++ dotted
413+ |= [l=(list tape)]
414+ ^- tape
415+ %- zing
416+ %+ join "." l
362417++ show-s
363418 |=(s=@s `tape`[?:((syn:si s) %$ '-') (slag 2 (scow %ui (abs:si s)))])
364419++ show-u