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
case
;;; -*- logo -*-

.macro case :case.value :case.clauses [:caseignoredp "true]
catch "case.error [output case.helper :case.value :case.clauses]
(throw "error [Empty CASE clause])
end

to case.helper :case.value :case.clauses
if emptyp :case.clauses [output []]
if emptyp first :case.clauses [throw "case.error]
if or equalp first first :case.clauses "else ~
      memberp :case.value first first :case.clauses ~
   [output butfirst first :case.clauses]
output case.helper :case.value butfirst :case.clauses
end

bury [case case.helper]
back to top