diff --git a/basis/core-foundation/run-loop/run-loop.factor b/basis/core-foundation/run-loop/run-loop.factor index 6446eacd08..10d858a32f 100644 --- a/basis/core-foundation/run-loop/run-loop.factor +++ b/basis/core-foundation/run-loop/run-loop.factor @@ -54,11 +54,7 @@ FUNCTION: void CFRunLoopRemoveTimer ( CFStringRef mode ) ; -: CFRunLoopDefaultMode ( -- alien ) - #! Ugly, but we don't have static NSStrings - \ CFRunLoopDefaultMode [ - "kCFRunLoopDefaultMode" - ] initialize-alien ; +CFSTRING: CFRunLoopDefaultMode "kCFRunLoopDefaultMode" TUPLE: run-loop fds sources timers ; diff --git a/basis/core-foundation/strings/strings.factor b/basis/core-foundation/strings/strings.factor index 413709d142..45f4460d13 100644 --- a/basis/core-foundation/strings/strings.factor +++ b/basis/core-foundation/strings/strings.factor @@ -83,3 +83,8 @@ FUNCTION: CFStringRef CFStringCreateWithCString ( : ( seq -- alien ) [ [ &CFRelease ] map ] with-destructors ; + +SYNTAX: CFSTRING: + CREATE scan-object + [ drop ] [ '[ _ [ _ ] initialize-alien ] ] 2bi + (( -- alien )) define-declared ;