https://github.com/jrincayc/ucblogo-code
Raw File
Tip revision: 7d4fd39c6d7afe4b0946839a1342c4ee4ef18d9b authored by Joshua J. Cogliati on 31 July 2020, 22:31:27 UTC
macOS needs to get the CXX and CC from wx to compile correctly.
Tip revision: 7d4fd39
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