From d6a35b5892099c267130a0d9022e33ff0a052858 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 4 Jun 2016 17:16:47 -0700 Subject: [PATCH] factor: IMPORT: -> import: --- demos/talks/tc-lisp-talk/tc-lisp-talk.factor | 2 +- demos/webkit-demo/webkit-demo.factor | 2 +- ffi/cocoa/cocoa-docs.factor | 8 ++-- ffi/cocoa/cocoa.factor | 1 + ffi/qtkit/qtkit.factor | 46 ++++++++++---------- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/demos/talks/tc-lisp-talk/tc-lisp-talk.factor b/demos/talks/tc-lisp-talk/tc-lisp-talk.factor index 4351788c04..23cc82a125 100644 --- a/demos/talks/tc-lisp-talk/tc-lisp-talk.factor +++ b/demos/talks/tc-lisp-talk/tc-lisp-talk.factor @@ -482,7 +482,7 @@ xyz } { $slide "Cocoa FFI" - { $code "IMPORT: NSAlert [ + { $code "import: NSAlert [ NSAlert -> new [ -> retain ] [ \"Raptor\" &CFRelease diff --git a/demos/webkit-demo/webkit-demo.factor b/demos/webkit-demo/webkit-demo.factor index 52abd8d416..4910ed8ae9 100644 --- a/demos/webkit-demo/webkit-demo.factor +++ b/demos/webkit-demo/webkit-demo.factor @@ -5,7 +5,7 @@ core-graphics.types kernel math.bitwise literals ; in: webkit-demo FRAMEWORK: /System/Library/Frameworks/WebKit.framework -IMPORT: WebView +import: WebView : rect ( -- rect ) 0 0 700 500 ; diff --git a/ffi/cocoa/cocoa-docs.factor b/ffi/cocoa/cocoa-docs.factor index ae3a97afdf..4ea55a71b6 100644 --- a/ffi/cocoa/cocoa-docs.factor +++ b/ffi/cocoa/cocoa-docs.factor @@ -16,16 +16,16 @@ HELP: SUPER-> { send super-send postpone: -> postpone: SUPER-> } related-words -HELP: IMPORT: -{ $syntax "IMPORT: name" } +HELP: import: +{ $syntax "import: name" } { $description "Makes an Objective C class available for use." } { $examples - { $code "IMPORT: QTMovie" "QTMovie \"My Movie.mov\" f -> movieWithFile:error:" } + { $code "import: QTMovie" "QTMovie \"My Movie.mov\" f -> movieWithFile:error:" } } ; ARTICLE: "objc-calling" "Calling Objective C code" "Before an Objective C class can be used, it must be imported; by default, a small set of common classes are imported automatically, but additional classes can be imported as needed." -{ $subsections postpone: IMPORT: } +{ $subsections postpone: import: } "Every imported Objective C class has as corresponding class word in the " { $vocab-link "cocoa.classes" } " vocabulary. Class words push the class object in the stack, allowing class methods to be invoked." $nl "Messages can be sent to classes and instances using a pair of parsing words:" diff --git a/ffi/cocoa/cocoa.factor b/ffi/cocoa/cocoa.factor index 5e02173ec6..664befa1ae 100644 --- a/ffi/cocoa/cocoa.factor +++ b/ffi/cocoa/cocoa.factor @@ -35,6 +35,7 @@ frameworks [ V{ } clone ] initialize SYNTAX: FRAMEWORK: scan-token [ load-framework ] [ frameworks get push ] bi ; SYNTAX: IMPORT: scan-token [ ] import-objc-class ; +SYNTAX: import: scan-token [ ] import-objc-class ; "Importing Cocoa classes..." print diff --git a/ffi/qtkit/qtkit.factor b/ffi/qtkit/qtkit.factor index bc95d2e8f8..ba5b769eb3 100644 --- a/ffi/qtkit/qtkit.factor +++ b/ffi/qtkit/qtkit.factor @@ -52,29 +52,29 @@ CONSTANT: QTErrorDeviceExcludedByAnotherDevice 1302 ; FRAMEWORK: /System/Library/Frameworks/QTKit.framework -IMPORT: QTCaptureAudioPreviewOutput -IMPORT: QTCaptureConnection -IMPORT: QTCaptureDecompressedAudioOutput -IMPORT: QTCaptureDecompressedVideoOutput -IMPORT: QTCaptureDevice -IMPORT: QTCaptureDeviceInput -IMPORT: QTCaptureFileOutput -IMPORT: QTCaptureInput -IMPORT: QTCaptureLayer -IMPORT: QTCaptureMovieFileOutput -IMPORT: QTCaptureOutput -IMPORT: QTCaptureSession -IMPORT: QTCaptureVideoPreviewOutput -IMPORT: QTCaptureView -IMPORT: QTCompressionOptions -IMPORT: QTDataReference -IMPORT: QTFormatDescription -IMPORT: QTMedia -IMPORT: QTMovie -IMPORT: QTMovieLayer -IMPORT: QTMovieView -IMPORT: QTSampleBuffer -IMPORT: QTTrack +import: QTCaptureAudioPreviewOutput +import: QTCaptureConnection +import: QTCaptureDecompressedAudioOutput +import: QTCaptureDecompressedVideoOutput +import: QTCaptureDevice +import: QTCaptureDeviceInput +import: QTCaptureFileOutput +import: QTCaptureInput +import: QTCaptureLayer +import: QTCaptureMovieFileOutput +import: QTCaptureOutput +import: QTCaptureSession +import: QTCaptureVideoPreviewOutput +import: QTCaptureView +import: QTCompressionOptions +import: QTDataReference +import: QTFormatDescription +import: QTMedia +import: QTMovie +import: QTMovieLayer +import: QTMovieView +import: QTSampleBuffer +import: QTTrack : ( filename -- movie ) QTMovie swap f -> movieWithFile:error: -> retain ;