Skip to content

Commit d5d9eed

Browse files
committed
Add ormap to stdlib since it's used in a86 code now.
1 parent 2b8a182 commit d5d9eed

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

langs/outlaw/compile.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
list->string string->list
7676
char<=? char=?
7777
remove-duplicates remq* remove* remove
78-
andmap vector list->vector boolean?
78+
andmap ormap vector list->vector boolean?
7979
substring odd?
8080
system-type ;; hard-coded
8181
not findf

langs/outlaw/stdlib.rkt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
list->string string->list
88
reverse
99
remove-duplicates remq* remove* remove
10-
andmap vector list->vector boolean? substring
10+
andmap ormap vector list->vector boolean? substring
1111
odd?
1212
system-type
1313
not
@@ -280,6 +280,13 @@
280280
(and (f x)
281281
(andmap f xs))]))
282282

283+
(define (ormap f xs)
284+
(match xs
285+
['() #f]
286+
[(cons x xs)
287+
(or (f x)
288+
(ormap f xs))]))
289+
283290
(define (list->vector xs)
284291
(list->vector/a (make-vector (length xs) 0) 0 xs))
285292

0 commit comments

Comments
 (0)