https://github.com/jrincayc/ucblogo-code
Revision ad2aafdb76721bf7ee061407f6a92e005841f163 authored by Joshua Cogliati on 28 June 2022, 01:19:29 UTC, committed by GitHub on 28 June 2022, 01:19:29 UTC
ISSUE-134: Fixed issue with LOADPICT if it's called before other turtle commands
2 parent s 7301609 + 3504376
Raw File
Tip revision: ad2aafdb76721bf7ee061407f6a92e005841f163 authored by Joshua Cogliati on 28 June 2022, 01:19:29 UTC
Merge pull request #135 from dmalec/ISSUE-134
Tip revision: ad2aafd
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