https://github.com/jrincayc/ucblogo-code
Revision 396c8f2fa6077e7c4b8b55683916aca734da6daa authored by Joshua J. Cogliati on 28 November 2019, 22:54:47 UTC, committed by Joshua J. Cogliati on 29 November 2019, 01:56:21 UTC
1 parent 2cdc440
Raw File
Tip revision: 396c8f2fa6077e7c4b8b55683916aca734da6daa authored by Joshua J. Cogliati on 28 November 2019, 22:54:47 UTC
Removing old wxWidgets 2.6 ifdefs and idndefing Blit that doesn't work in mac
Tip revision: 396c8f2
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