Revision 9e69e3271e296b7a329e44150d9c1f4adf9ce442 authored by Joshua Cogliati on 29 October 2020, 01:34:09 UTC, committed by GitHub on 29 October 2020, 01:34:09 UTC
ISSUE-36: Handle command line arguments across environments.
2 parent s 12004aa + 09a7358
Raw File
foreach
;;; -*- logo -*-

.macro foreach [:foreach.inputs] 2
catch "foreach.catchtag ~
      [op foreach.done runresult ~
	    [foreach1 bl :foreach.inputs last :foreach.inputs 1]]
op []
end

to foreach1 :template.lists :foreach.template :template.number
if emptyp first :template.lists [throw "foreach.catchtag]
apply :foreach.template firsts :template.lists
.maybeoutput foreach1 bfs :template.lists :foreach.template :template.number+1
end

to foreach.done :foreach.result
if emptyp :foreach.result [op [stop]]
op (list "output "first (list first :foreach.result))
end

to ?rest [:which 1]
output bf item :which :template.lists
end

bury [foreach foreach1 foreach.done ?rest]
back to top