From b9e2b14cf0ce1ce6f91f2ea509c736301986191a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 27 Oct 2017 20:24:37 -0500 Subject: [PATCH] modern: fix FOO>bar to \FOO>bar --- basis/calendar/windows/windows.factor | 4 +-- .../cocoa/application/application-docs.factor | 2 +- basis/cocoa/application/application.factor | 2 +- basis/cocoa/dialogs/dialogs.factor | 4 +-- basis/cocoa/nibs/nibs.factor | 2 +- basis/cocoa/pasteboard/pasteboard.factor | 4 +-- basis/cocoa/plists/plists.factor | 2 +- .../known-words/known-words.factor | 2 +- .../core-foundation/arrays/arrays-docs.factor | 2 +- .../arrays/arrays-tests.factor | 2 +- basis/core-foundation/arrays/arrays.factor | 2 +- .../dictionaries/dictionaries-tests.factor | 2 +- .../strings/strings-docs.factor | 4 +-- .../strings/strings-tests.factor | 8 ++--- basis/core-foundation/strings/strings.factor | 12 ++++---- basis/game/input/iokit/iokit.factor | 2 +- basis/io/files/info/windows/windows.factor | 14 ++++----- basis/io/files/temp/macosx/macosx.factor | 2 +- basis/math/functions/functions.factor | 4 +-- .../rectangles/prettyprint/prettyprint.factor | 2 +- basis/math/rectangles/rectangles-tests.factor | 30 +++++++++---------- basis/math/rectangles/rectangles.factor | 2 +- basis/math/statistics/statistics.factor | 2 +- basis/sorting/human/human.factor | 2 +- basis/ui/backend/cocoa/tools/tools.factor | 2 +- basis/ui/backend/cocoa/views/views.factor | 10 +++---- basis/ui/backend/windows/windows.factor | 2 +- extra/math/approx/approx.factor | 6 ++-- extra/math/hashcodes/hashcodes.factor | 2 +- extra/math/text/english/english.factor | 2 +- extra/math/text/french/french.factor | 2 +- extra/metar/metar.factor | 16 +++++----- extra/project-euler/057/057.factor | 2 +- extra/project-euler/common/common.factor | 2 +- misc/vim/syntax/factor.vim | 2 +- 35 files changed, 81 insertions(+), 81 deletions(-) diff --git a/basis/calendar/windows/windows.factor b/basis/calendar/windows/windows.factor index 80253ea91b..f02c910491 100644 --- a/basis/calendar/windows/windows.factor +++ b/basis/calendar/windows/windows.factor @@ -18,7 +18,7 @@ IN: calendar.windows ] } cleave \ SYSTEMTIME ; -: SYSTEMTIME>timestamp ( SYSTEMTIME -- timestamp ) +: \SYSTEMTIME>timestamp ( SYSTEMTIME -- timestamp ) { [ wYear>> ] [ wMonth>> ] @@ -38,4 +38,4 @@ M: windows gmt-offset ( -- hours minutes seconds ) } case neg 60 /mod 0 ; M: windows gmt - SYSTEMTIME [ GetSystemTime ] keep SYSTEMTIME>timestamp ; + SYSTEMTIME [ GetSystemTime ] keep \SYSTEMTIME>timestamp ; diff --git a/basis/cocoa/application/application-docs.factor b/basis/cocoa/application/application-docs.factor index a1871e786f..c578ddcbb3 100644 --- a/basis/cocoa/application/application-docs.factor +++ b/basis/cocoa/application/application-docs.factor @@ -6,7 +6,7 @@ HELP: { $values { "str" string } { "alien" alien } } { $description "Allocates an autoreleased " { $snippet "CFString" } "." } ; -{ CF>string } related-words +{ CFString>string } related-words HELP: with-autorelease-pool { $values { "quot" quotation } } diff --git a/basis/cocoa/application/application.factor b/basis/cocoa/application/application.factor index 6168f04886..7c320b0fe2 100644 --- a/basis/cocoa/application/application.factor +++ b/basis/cocoa/application/application.factor @@ -41,7 +41,7 @@ FUNCTION: void NSBeep ( ) : running.app? ( -- ? ) ! Test if we're running a .app. ".app" - NSBundle send: mainBundle send: bundlePath CF>string + NSBundle send: mainBundle send: bundlePath CFString>string subseq? ; : assert.app ( message -- ) diff --git a/basis/cocoa/dialogs/dialogs.factor b/basis/cocoa/dialogs/dialogs.factor index 8016789208..80a9f66beb 100644 --- a/basis/cocoa/dialogs/dialogs.factor +++ b/basis/cocoa/dialogs/dialogs.factor @@ -25,7 +25,7 @@ CONSTANT: NSCancelButton 0 : (open-panel) ( panel -- paths ) dup send: runModal NSOKButton = - [ send: filenames CF>string-array ] [ drop f ] if ; + [ send: filenames CFString>string-array ] [ drop f ] if ; : open-panel ( -- paths ) (open-panel) ; @@ -37,4 +37,4 @@ CONSTANT: NSCancelButton 0 : save-panel ( path -- path/f ) [ dup ] dip split-path send: \runModalForDirectory:file: NSOKButton = - [ send: filename CF>string ] [ drop f ] if ; + [ send: filename CFString>string ] [ drop f ] if ; diff --git a/basis/cocoa/nibs/nibs.factor b/basis/cocoa/nibs/nibs.factor index 951100a9b7..95f02751a4 100644 --- a/basis/cocoa/nibs/nibs.factor +++ b/basis/cocoa/nibs/nibs.factor @@ -17,4 +17,4 @@ IN: cocoa.nibs f { void* } [ send: \instantiateNibWithOwner:topLevelObjects: ] with-out-parameters - swap [ CF>array ] [ drop f ] if ; + swap [ CFArray>array ] [ drop f ] if ; diff --git a/basis/cocoa/pasteboard/pasteboard.factor b/basis/cocoa/pasteboard/pasteboard.factor index 8e68430545..1d96282394 100644 --- a/basis/cocoa/pasteboard/pasteboard.factor +++ b/basis/cocoa/pasteboard/pasteboard.factor @@ -8,11 +8,11 @@ IN: cocoa.pasteboard CONSTANT: NSStringPboardType "NSStringPboardType" : pasteboard-string? ( pasteboard -- ? ) - NSStringPboardType swap send: types CF>string-array member? ; + NSStringPboardType swap send: types CFString>string-array member? ; : pasteboard-string ( pasteboard -- str ) NSStringPboardType send: \stringForType: - dup [ CF>string ] when ; + dup [ CFString>string ] when ; : set-pasteboard-types ( seq pasteboard -- ) swap send: autorelease f send: \declareTypes:owner: drop ; diff --git a/basis/cocoa/plists/plists.factor b/basis/cocoa/plists/plists.factor index 2c71259dc8..3ae02c802f 100644 --- a/basis/cocoa/plists/plists.factor +++ b/basis/cocoa/plists/plists.factor @@ -52,7 +52,7 @@ ERROR: invalid-plist-object object ; : plist> ( plist -- value ) { - { NSString [ CF>string ] } + { NSString [ CFString>string ] } { NSNumber [ (plist-NSNumber>) ] } { NSData [ (plist-NSData>) ] } { NSArray [ (plist-NSArray>) ] } diff --git a/basis/compiler/tree/propagation/known-words/known-words.factor b/basis/compiler/tree/propagation/known-words/known-words.factor index 1ae3e90692..954ecc1df6 100644 --- a/basis/compiler/tree/propagation/known-words/known-words.factor +++ b/basis/compiler/tree/propagation/known-words/known-words.factor @@ -286,7 +286,7 @@ generic-comparison-ops [ { numerator denominator } [ [ drop integer ] "outputs" set-word-prop ] each -\ >fraction [ +\ fraction>parts [ drop integer dup ] "outputs" set-word-prop diff --git a/basis/core-foundation/arrays/arrays-docs.factor b/basis/core-foundation/arrays/arrays-docs.factor index ae3622cfdb..83da0f7d4e 100644 --- a/basis/core-foundation/arrays/arrays-docs.factor +++ b/basis/core-foundation/arrays/arrays-docs.factor @@ -1,7 +1,7 @@ USING: help.syntax help.markup arrays alien ; IN: core-foundation.arrays -HELP: CF>array +HELP: CFArray>array { $values { "alien" "a " { $snippet "CFArray" } } { "array" "an array of " { $link alien } " instances" } } { $description "Creates a Factor array from a Core Foundation array." } ; diff --git a/basis/core-foundation/arrays/arrays-tests.factor b/basis/core-foundation/arrays/arrays-tests.factor index 28fbeaf990..32eaef2988 100644 --- a/basis/core-foundation/arrays/arrays-tests.factor +++ b/basis/core-foundation/arrays/arrays-tests.factor @@ -6,6 +6,6 @@ core-foundation.strings destructors sequences tools.test ; [ { "1" "2" "3" } [ &CFRelease ] map - CF>string-array + CFString>string-array ] with-destructors ] unit-test diff --git a/basis/core-foundation/arrays/arrays.factor b/basis/core-foundation/arrays/arrays.factor index 71b02c2f8b..9e4621dc5c 100644 --- a/basis/core-foundation/arrays/arrays.factor +++ b/basis/core-foundation/arrays/arrays.factor @@ -14,7 +14,7 @@ FUNCTION: void CFArraySetValueAtIndex ( CFArrayRef array, CFIndex index, void* v FUNCTION: CFIndex CFArrayGetCount ( CFArrayRef array ) -: CF>array ( alien -- array ) +: CFArray>array ( alien -- array ) dup CFArrayGetCount [ CFArrayGetValueAtIndex ] with { } map-integers ; diff --git a/basis/core-foundation/dictionaries/dictionaries-tests.factor b/basis/core-foundation/dictionaries/dictionaries-tests.factor index dff7884918..3637abf7a7 100644 --- a/basis/core-foundation/dictionaries/dictionaries-tests.factor +++ b/basis/core-foundation/dictionaries/dictionaries-tests.factor @@ -13,6 +13,6 @@ IN: core-foundation.dictionaries.tests 2array 1array &CFRelease "key" get CFDictionaryGetValue - dup [ CF>string ] when + dup [ CFString>string ] when ] with-destructors ] unit-test diff --git a/basis/core-foundation/strings/strings-docs.factor b/basis/core-foundation/strings/strings-docs.factor index 4c12fb5d52..19c377a113 100644 --- a/basis/core-foundation/strings/strings-docs.factor +++ b/basis/core-foundation/strings/strings-docs.factor @@ -5,10 +5,10 @@ HELP: { $values { "string" string } { "alien" "a " { $snippet "CFString" } } } { $description "Creates a Core Foundation string from a Factor string." } ; -HELP: CF>string +HELP: CFString>string { $values { "alien" "a " { $snippet "CFString" } } { "string" string } } { $description "Creates a Factor string from a Core Foundation string." } ; -HELP: CF>string-array +HELP: CFString>string-array { $values { "alien" "a " { $snippet "CFArray" } " of " { $snippet "CFString" } " instances" } { "seq" string } } { $description "Creates an array of Factor strings from a " { $snippet "CFArray" } " of " { $snippet "CFString" } "s." } ; diff --git a/basis/core-foundation/strings/strings-tests.factor b/basis/core-foundation/strings/strings-tests.factor index 4b07fbcb91..5079d77d33 100644 --- a/basis/core-foundation/strings/strings-tests.factor +++ b/basis/core-foundation/strings/strings-tests.factor @@ -5,11 +5,11 @@ strings ; IN: core-foundation { } [ "Hello" CFRelease ] unit-test -{ "Hello" } [ "Hello" [ CF>string ] [ CFRelease ] bi ] unit-test -{ "Hello\u003456" } [ "Hello\u003456" [ CF>string ] [ CFRelease ] bi ] unit-test -{ "Hello\u013456" } [ "Hello\u013456" [ CF>string ] [ CFRelease ] bi ] unit-test +{ "Hello" } [ "Hello" [ CFString>string ] [ CFRelease ] bi ] unit-test +{ "Hello\u003456" } [ "Hello\u003456" [ CFString>string ] [ CFRelease ] bi ] unit-test +{ "Hello\u013456" } [ "Hello\u013456" [ CFString>string ] [ CFRelease ] bi ] unit-test { } [ "\0" CFRelease ] unit-test -{ "\0" } [ "\0" [ CF>string ] [ CFRelease ] bi ] unit-test +{ "\0" } [ "\0" [ CFString>string ] [ CFRelease ] bi ] unit-test ! This shouldn't fail { } [ { 0x123456 } >string CFRelease ] unit-test diff --git a/basis/core-foundation/strings/strings.factor b/basis/core-foundation/strings/strings.factor index a48ae31bb6..f03081f9cf 100644 --- a/basis/core-foundation/strings/strings.factor +++ b/basis/core-foundation/strings/strings.factor @@ -79,7 +79,7 @@ FUNCTION: CFStringRef CFCopyTypeIDDescription ( CFTypeID type_id ) CFStringCreateWithBytes [ "CFStringCreateWithBytes failed" throw ] unless* ; -: CF>string ( alien -- string ) +: CFString>string ( alien -- string ) dup CFStringGetLength [ 0 swap kCFStringEncodingUTF8 0 f ] keep 4 * 1 + [ @@ -87,16 +87,16 @@ FUNCTION: CFStringRef CFCopyTypeIDDescription ( CFTypeID type_id ) { CFIndex } [ CFStringGetBytes drop ] with-out-parameters ] keep swap >>length utf8 decode ; -: CF>string-array ( alien -- seq ) - CF>array [ CF>string ] map ; +: CFString>string-array ( alien -- seq ) + CFArray>array [ CFString>string ] map ; : ( seq -- alien ) [ [ &CFRelease ] map ] with-destructors ; -: CF>description ( cf -- description ) - [ CFCopyDescription &CFRelease CF>string ] with-destructors ; +: CFString>description ( cf -- description ) + [ CFCopyDescription &CFRelease CFString>string ] with-destructors ; : CFType>description ( cf -- description ) - CFGetTypeID [ CFCopyTypeIDDescription &CFRelease CF>string ] with-destructors ; + CFGetTypeID [ CFCopyTypeIDDescription &CFRelease CFString>string ] with-destructors ; SYNTAX: \CFSTRING: scan-new-word scan-object diff --git a/basis/game/input/iokit/iokit.factor b/basis/game/input/iokit/iokit.factor index 44518c6ad9..750e818a13 100644 --- a/basis/game/input/iokit/iokit.factor +++ b/basis/game/input/iokit/iokit.factor @@ -276,7 +276,7 @@ M: iokit-game-input-backend reset-mouse [ drop "input callback doesn't know how to deal with " - swap CF>description append throw + swap CFString>description append throw ] } cond ; diff --git a/basis/io/files/info/windows/windows.factor b/basis/io/files/info/windows/windows.factor index 4922f7c0ef..ca166cf9d2 100755 --- a/basis/io/files/info/windows/windows.factor +++ b/basis/io/files/info/windows/windows.factor @@ -35,9 +35,9 @@ TUPLE: windows-file-info < file-info-tuple attributes ; [ dwFileAttributes>> win32-file-attributes >>attributes ] [ [ nFileSizeLow>> ] [ nFileSizeHigh>> ] bi >64bit >>size ] [ dwFileAttributes>> >>permissions ] - [ ftCreationTime>> FILETIME>timestamp >>created ] - [ ftLastWriteTime>> FILETIME>timestamp >>modified ] - [ ftLastAccessTime>> FILETIME>timestamp >>accessed ] + [ ftCreationTime>> filetime>timestamp >>created ] + [ ftLastWriteTime>> filetime>timestamp >>modified ] + [ ftLastAccessTime>> filetime>timestamp >>accessed ] } cleave ; : find-first-file-stat ( path -- WIN32_FIND_DATA ) @@ -57,9 +57,9 @@ TUPLE: windows-file-info < file-info-tuple attributes ; [ nFileSizeHigh>> ] bi >64bit >>size ] [ dwFileAttributes>> >>permissions ] - [ ftCreationTime>> FILETIME>timestamp >>created ] - [ ftLastWriteTime>> FILETIME>timestamp >>modified ] - [ ftLastAccessTime>> FILETIME>timestamp >>accessed ] + [ ftCreationTime>> filetime>timestamp >>created ] + [ ftLastWriteTime>> filetime>timestamp >>modified ] + [ ftLastAccessTime>> filetime>timestamp >>accessed ] ! [ nNumberOfLinks>> ] ! [ ! [ nFileIndexLow>> ] @@ -228,7 +228,7 @@ M: windows file-systems ( -- array ) { FILETIME FILETIME FILETIME } [ GetFileTime win32-error=0/f ] with-out-parameters - [ FILETIME>timestamp >local-time ] tri@ + [ filetime>timestamp >local-time ] tri@ ] with-destructors ; : set-file-times ( path timestamp/f timestamp/f timestamp/f -- ) diff --git a/basis/io/files/temp/macosx/macosx.factor b/basis/io/files/temp/macosx/macosx.factor index ef88fbe532..991fbcfdee 100644 --- a/basis/io/files/temp/macosx/macosx.factor +++ b/basis/io/files/temp/macosx/macosx.factor @@ -33,7 +33,7 @@ CONSTANT: factor-bundle-name "org.factorcode.Factor" PRIVATE> M: macosx default-temp-directory - NSTemporaryDirectory CF>string factor-bundle-subdir ; + NSTemporaryDirectory CFString>string factor-bundle-subdir ; M: macosx default-cache-directory NSCachesDirectory NSUserDomainMask 1 NSSearchPathForDirectoriesInDomains diff --git a/basis/math/functions/functions.factor b/basis/math/functions/functions.factor index ab19faf078..0ac968a266 100644 --- a/basis/math/functions/functions.factor +++ b/basis/math/functions/functions.factor @@ -40,7 +40,7 @@ M: bignum ^n [ factor-2s ] dip [ (^n) ] keep rot * shift ; M: ratio ^n - [ >fraction ] dip '[ _ ^n ] bi@ / ; + [ fraction>parts ] dip '[ _ ^n ] bi@ / ; M: float ^n (^n) ; @@ -397,7 +397,7 @@ M: integer round-to-odd ; inline [ >integer even? ] (round-tiebreak?) ; inline : (ratio-round) ( x round-quot -- y ) - [ >fraction [ /mod dup swapd abs 2 * ] keep ] [ call ] bi* + [ fraction>parts [ /mod dup swapd abs 2 * ] keep ] [ call ] bi* [ swap 0 < -1 1 ? + ] [ nip ] if ; inline : (float-round) ( x round-quot -- y ) diff --git a/basis/math/rectangles/prettyprint/prettyprint.factor b/basis/math/rectangles/prettyprint/prettyprint.factor index 68934e1284..443e3f90af 100644 --- a/basis/math/rectangles/prettyprint/prettyprint.factor +++ b/basis/math/rectangles/prettyprint/prettyprint.factor @@ -5,7 +5,7 @@ IN: math.rectangles.prettyprint M: rect pprint* [ - \ rect: [ + \ rect:: [ [ loc>> ] [ dim>> ] bi [ pprint* ] bi@ ] pprint-prefix ] check-recursion ; diff --git a/basis/math/rectangles/rectangles-tests.factor b/basis/math/rectangles/rectangles-tests.factor index 594f59b889..b8fefca3c3 100644 --- a/basis/math/rectangles/rectangles-tests.factor +++ b/basis/math/rectangles/rectangles-tests.factor @@ -2,39 +2,39 @@ USING: tools.test math.rectangles prettyprint io.streams.string kernel accessors ; IN: math.rectangles.tests -{ rect: { 10 10 } { 20 20 } } +{ rect:: { 10 10 } { 20 20 } } [ - rect: { 10 10 } { 50 50 } - rect: { -10 -10 } { 40 40 } + rect:: { 10 10 } { 50 50 } + rect:: { -10 -10 } { 40 40 } rect-intersect ] unit-test -{ rect: { 200 200 } { 0 0 } } +{ rect:: { 200 200 } { 0 0 } } [ - rect: { 100 100 } { 50 50 } - rect: { 200 200 } { 40 40 } + rect:: { 100 100 } { 50 50 } + rect:: { 200 200 } { 40 40 } rect-intersect ] unit-test { f } [ - rect: { 100 100 } { 50 50 } - rect: { 200 200 } { 40 40 } + rect:: { 100 100 } { 50 50 } + rect:: { 200 200 } { 40 40 } contains-rect? ] unit-test { t } [ - rect: { 100 100 } { 50 50 } - rect: { 120 120 } { 40 40 } + rect:: { 100 100 } { 50 50 } + rect:: { 120 120 } { 40 40 } contains-rect? ] unit-test { f } [ - rect: { 1000 100 } { 50 50 } - rect: { 120 120 } { 40 40 } + rect:: { 1000 100 } { 50 50 } + rect:: { 120 120 } { 40 40 } contains-rect? ] unit-test -{ rect: { 10 20 } { 20 20 } } [ +{ rect:: { 10 20 } { 20 20 } } [ { { 20 20 } { 10 40 } @@ -42,5 +42,5 @@ IN: math.rectangles.tests } rect-containing ] unit-test -! Prettyprint for rect: didn't do nesting check properly -{ } [ [ rect: f f dup >>dim . ] with-string-writer drop ] unit-test +! Prettyprint for rect:: didn't do nesting check properly +{ } [ [ rect:: f f dup >>dim . ] with-string-writer drop ] unit-test diff --git a/basis/math/rectangles/rectangles.factor b/basis/math/rectangles/rectangles.factor index fc26dc8ce7..48f90b0509 100644 --- a/basis/math/rectangles/rectangles.factor +++ b/basis/math/rectangles/rectangles.factor @@ -8,7 +8,7 @@ TUPLE: rect { loc initial: { 0 0 } } { dim initial: { 0 0 } } ; : ( loc dim -- rect ) rect boa ; inline -SYNTAX: \rect: scan-object scan-object suffix! ; +SYNTAX: \rect:: scan-object scan-object suffix! ; : ( -- rect ) rect new ; inline diff --git a/basis/math/statistics/statistics.factor b/basis/math/statistics/statistics.factor index 15693f999f..a377481368 100644 --- a/basis/math/statistics/statistics.factor +++ b/basis/math/statistics/statistics.factor @@ -161,7 +161,7 @@ PRIVATE> ! 2+1/4 frac is 1/4 : frac ( x -- x' ) - >fraction [ /mod nip ] keep / ; inline + fraction>parts [ /mod nip ] keep / ; inline :: quantile-indices ( seq qs a b -- seq ) qs [ [ a b seq length ] dip quantile-x ] map ; diff --git a/basis/sorting/human/human.factor b/basis/sorting/human/human.factor index a6eaf52bd4..51baf50d22 100644 --- a/basis/sorting/human/human.factor +++ b/basis/sorting/human/human.factor @@ -32,7 +32,7 @@ TUPLE: alphanum obj ; : ( obj -- alphanum ) alphanum new - swap dup string? [ w/collation-key ] when >>obj ; inline + swap dup string? [ collation-key/nfd drop ] when >>obj ; inline M: alphanum <=> [ obj>> ] bi@ diff --git a/basis/ui/backend/cocoa/tools/tools.factor b/basis/ui/backend/cocoa/tools/tools.factor index cf05d7b1f7..4df52306a3 100644 --- a/basis/ui/backend/cocoa/tools/tools.factor +++ b/basis/ui/backend/cocoa/tools/tools.factor @@ -10,7 +10,7 @@ FROM: alien.c-types => int void ; IN: ui.backend.cocoa.tools : finder-run-files ( alien -- ) - CF>string-array listener-run-files + CFString>string-array listener-run-files NSApp NSApplicationDelegateReplySuccess send: \replyToOpenOrPrint: ; diff --git a/basis/ui/backend/cocoa/views/views.factor b/basis/ui/backend/cocoa/views/views.factor index 216b05fdad..4455ffb080 100644 --- a/basis/ui/backend/cocoa/views/views.factor +++ b/basis/ui/backend/cocoa/views/views.factor @@ -70,7 +70,7 @@ CONSTANT: key-codes : key-code ( event -- string ? ) dup send: keyCode key-codes at - [ t ] [ send: charactersIgnoringModifiers CF>string f ] ?if ; + [ t ] [ send: charactersIgnoringModifiers CFString>string f ] ?if ; : event-modifiers ( event -- modifiers ) send: modifierFlags modifiers modifier ; @@ -126,7 +126,7 @@ CONSTANT: key-codes ] dip add-observer ; : string-or-nil? ( NSString -- ? ) - [ CF>string NSStringPboardType = ] [ t ] if* ; + [ CFString>string NSStringPboardType = ] [ t ] if* ; : valid-service? ( gadget send-type return-type -- ? ) 2dup [ string-or-nil? ] [ string-or-nil? ] bi* and @@ -194,7 +194,7 @@ CONSTANT: selector>action H{ METHOD: Class makeTouchBar [ default-touchbar self make-touchbar ] ; METHOD: Class touchBar: Class touchbar makeItemForIdentifier: Class string [ - string CF>string + string CFString>string { { "refresh-all-action" [ self "refresh-all-action" "refresh-all" "refreshAllAction" make-NSTouchBar-button @@ -317,7 +317,7 @@ CONSTANT: selector>action H{ METHOD: char writeSelectionToPasteboard: id pboard types: id types [ - NSStringPboardType types CF>string-array member? [ + NSStringPboardType types CFString>string-array member? [ self window [ world-focus gadget-selection [ pboard set-pasteboard-string 1 ] [ 0 ] if* @@ -339,7 +339,7 @@ CONSTANT: selector>action H{ [ self window :> window window [ - text CF>string window user-input + text CFString>string window user-input ] when ] ; diff --git a/basis/ui/backend/windows/windows.factor b/basis/ui/backend/windows/windows.factor index 1c0030a8d4..09c10977cd 100755 --- a/basis/ui/backend/windows/windows.factor +++ b/basis/ui/backend/windows/windows.factor @@ -488,7 +488,7 @@ SYMBOL: nc-buttons 4drop forget-rollover ; : system-background-color ( -- color ) - COLOR_BTNFACE GetSysColor RGB>color ; + COLOR_BTNFACE GetSysColor \RGB>color ; : ?make-glass ( world hwnd -- ) over window-controls>> textured-background swap member-eq? [ diff --git a/extra/math/approx/approx.factor b/extra/math/approx/approx.factor index a83b442c9b..8668028030 100644 --- a/extra/math/approx/approx.factor +++ b/extra/math/approx/approx.factor @@ -14,7 +14,7 @@ IN: math.approx { [ r zero? ] [ q ] } { [ q q' = not ] [ q 1 + ] } [ - d' r' d r (simplest) >fraction :> ( n'' d'' ) + d' r' d r (simplest) fraction>parts :> ( n'' d'' ) q n'' * d'' + n'' / ] } cond ; @@ -23,8 +23,8 @@ IN: math.approx { { [ x y > ] [ y x simplest ] } { [ x y = ] [ x ] } - { [ x 0 > ] [ x y [ >fraction ] bi@ (simplest) ] } - { [ y 0 < ] [ y x [ neg >fraction ] bi@ (simplest) neg ] } + { [ x 0 > ] [ x y [ fraction>parts ] bi@ (simplest) ] } + { [ y 0 < ] [ y x [ neg fraction>parts ] bi@ (simplest) neg ] } [ 0 ] } cond ; diff --git a/extra/math/hashcodes/hashcodes.factor b/extra/math/hashcodes/hashcodes.factor index 9fd454e51e..f040f5b76a 100644 --- a/extra/math/hashcodes/hashcodes.factor +++ b/extra/math/hashcodes/hashcodes.factor @@ -35,7 +35,7 @@ PRIVATE> M: integer number-hashcode 1 hash-fraction ; -M: ratio number-hashcode >fraction hash-fraction ; +M: ratio number-hashcode fraction>parts hash-fraction ; M: float number-hashcode ( x -- h ) { diff --git a/extra/math/text/english/english.factor b/extra/math/text/english/english.factor index a790ada4e9..16f3305b98 100644 --- a/extra/math/text/english/english.factor +++ b/extra/math/text/english/english.factor @@ -96,7 +96,7 @@ M: integer number>text [ "zero" ] [ [ (number>text) ] with-scope ] if-zero ; M: ratio number>text - >fraction [ number>text ] bi@ " divided by " glue ; + fraction>parts [ number>text ] bi@ " divided by " glue ; M: float number>text number>string "." split1 [ diff --git a/extra/math/text/french/french.factor b/extra/math/text/french/french.factor index 14616c6e9f..4a15384eec 100644 --- a/extra/math/text/french/french.factor +++ b/extra/math/text/french/french.factor @@ -110,6 +110,6 @@ M: integer number>text dup abs 102 10^ >= [ number>string ] [ basic ] if ; M: ratio number>text - >fraction [ [ number>text ] keep ] [ divisor ] bi* + fraction>parts [ [ number>text ] keep ] [ divisor ] bi* swap abs 1 > [ pluralize ] when space-append ; diff --git a/extra/metar/metar.factor b/extra/metar/metar.factor index 736a538643..202479feed 100644 --- a/extra/metar/metar.factor +++ b/extra/metar/metar.factor @@ -261,15 +261,15 @@ CONSTANT: sky H{ tri* 3append ] unless ; -: F>C ( F -- C ) 32 - 5/9 * ; +: \F>C ( F -- C ) 32 - 5/9 * ; -: C>F ( C -- F ) 9/5 * 32 + ; +: \C>F ( C -- F ) 9/5 * 32 + ; : parse-temperature ( str -- temp dew-point ) "/" split1 [ [ f ] [ "M" ?head [ string>number ] [ [ neg ] when ] bi* - dup C>F "%d °C (%.1f °F)" sprintf + dup \C>F "%d °C (%.1f °F)" sprintf ] if-empty ] bi@ ; @@ -352,24 +352,24 @@ CONSTANT: re-altimeter R[[ [AQ]\d{4}]] : parse-1hr-temp ( str -- str' ) "T" ?head drop dup length 4 > [ double-value - [ dup C>F "%.1f °C (%.1f °F)" sprintf ] bi@ + [ dup \C>F "%.1f °C (%.1f °F)" sprintf ] bi@ "hourly temperature %s and dew point %s" sprintf ] [ - single-value dup C>F + single-value dup \C>F "hourly temperature %.1f °C (%.1f °F)" sprintf ] if ; : parse-6hr-max-temp ( str -- str' ) - "1" ?head drop single-value dup C>F + "1" ?head drop single-value dup \C>F "6-hour maximum temperature %.1f °C (%.1f °F)" sprintf ; : parse-6hr-min-temp ( str -- str' ) - "2" ?head drop single-value dup C>F + "2" ?head drop single-value dup \C>F "6-hour minimum temperature %.1f °C (%.1f °F)" sprintf ; : parse-24hr-temp ( str -- str' ) "4" ?head drop double-value - [ dup C>F "%.1f °C (%.1f °F)" sprintf ] bi@ + [ dup \C>F "%.1f °C (%.1f °F)" sprintf ] bi@ "24-hour maximum temperature %s minimum temperature %s" sprintf ; diff --git a/extra/project-euler/057/057.factor b/extra/project-euler/057/057.factor index 2850881ac5..baa794462f 100644 --- a/extra/project-euler/057/057.factor +++ b/extra/project-euler/057/057.factor @@ -33,7 +33,7 @@ IN: project-euler.057 ! -------- : longer-numerator? ( seq -- ? ) - >fraction [ number>string length ] bi@ > ; inline + fraction>parts [ number>string length ] bi@ > ; inline : euler057 ( -- answer ) 0 1000 [ drop 2 + recip dup 1 + longer-numerator? ] count nip ; diff --git a/extra/project-euler/common/common.factor b/extra/project-euler/common/common.factor index b24743e495..2db0cf4d35 100644 --- a/extra/project-euler/common/common.factor +++ b/extra/project-euler/common/common.factor @@ -69,7 +69,7 @@ PRIVATE> >lower [ char: a - 1 + ] map-sum ; : mediant ( a/c b/d -- (a+b)/(c+d) ) - 2>fraction [ + ] 2bi@ / ; + 2fraction>parts [ + ] 2bi@ / ; : max-path ( triangle -- n ) dup length 1 > [ diff --git a/misc/vim/syntax/factor.vim b/misc/vim/syntax/factor.vim index 5aaf1268a4..48a858e8fe 100644 --- a/misc/vim/syntax/factor.vim +++ b/misc/vim/syntax/factor.vim @@ -56,7 +56,7 @@ syn keyword factorCallNextMethod call-next-method syn keyword factorKeyword (clone) -rot 2bi 2bi* 2bi@ 2curry 2dip 2drop 2dup 2keep 2nip 2over 2tri 2tri* 2tri@ 2with 3bi 3curry 3dip 3drop 3dup 3keep 3tri 4dip 4drop 4dup 4keep = >boolean ? ?if and assert assert= assert? bi bi* bi-curry bi-curry* bi-curry@ bi@ boa boolean boolean? both? build call callstack callstack>array callstack? clear clone compose composed? curry curried? die dip do drop dup dupd either? eq? equal? execute get-callstack get-datastack get-retainstack hashcode hashcode* identity-hashcode identity-tuple identity-tuple? if if* keep loop most new nip not null object or over pick prepose rot same? swap swapd throw tri tri* tri-curry tri-curry* tri-curry@ tri@ tuple tuple? unless unless* until when when* while with wrapper wrapper? xor syn keyword factorKeyword 2cache >alist ?at ?of assoc assoc-all? assoc-any? assoc-clone-like assoc-combine assoc-diff assoc-diff! assoc-differ assoc-each assoc-empty? assoc-filter assoc-filter! assoc-filter-as assoc-find assoc-hashcode assoc-intersect assoc-like assoc-map assoc-map-as assoc-partition assoc-refine assoc-reject assoc-reject! assoc-reject-as assoc-size assoc-stack assoc-subset? assoc-union assoc-union! assoc= assoc>map assoc? at at* at+ cache change-at clear-assoc delete-at delete-at* enum enum? extract-keys harvest-keys harvest-values inc-at key? keys map>alist map>assoc maybe-set-at new-assoc of push-at rename-at set-at sift-keys sift-values substitute unzip value-at value-at* value? values zip zip-as zip-index zip-index-as syn keyword factorKeyword 2cleave 2cleave>quot 3cleave 3cleave>quot 4cleave 4cleave>quot alist>quot call-effect case case-find case>quot cleave cleave>quot cond cond>quot deep-spread>quot execute-effect linear-case-quot no-case no-case? no-cond no-cond? recursive-hashcode shallow-spread>quot spread to-fixed-point wrong-values wrong-values? -syn keyword factorKeyword (all-integers?) (each-integer) (find-integer) * + - / /f /i /mod 2/ 2^ < <= > >= >bignum >fixnum >float >fraction >integer >rect ?1+ abs align all-integers? bignum bignum? bit? bitand bitnot bitor bits>double bits>float bitxor complex complex? denominator double>bits each-integer even? fast-gcd find-integer find-last-integer fixnum fixnum? float float>bits float? fp-bitwise= fp-infinity? fp-nan-payload fp-nan? fp-qnan? fp-sign fp-snan? fp-special? gcd if-zero imaginary-part integer integer>fixnum integer>fixnum-strict integer? log2 log2-expects-positive log2-expects-positive? mod neg neg? next-float next-power-of-2 number number= number? numerator odd? power-of-2? prev-float ratio ratio? rational rational? real real-part real? recip rect> rem sgn shift sq times u< u<= u> u>= unless-zero unordered? when-zero zero? +syn keyword factorKeyword (all-integers?) (each-integer) (find-integer) * + - / /f /i /mod 2/ 2^ < <= > >= >bignum >fixnum >float fraction>parts >integer >rect ?1+ abs align all-integers? bignum bignum? bit? bitand bitnot bitor bits>double bits>float bitxor complex complex? denominator double>bits each-integer even? fast-gcd find-integer find-last-integer fixnum fixnum? float float>bits float? fp-bitwise= fp-infinity? fp-nan-payload fp-nan? fp-qnan? fp-sign fp-snan? fp-special? gcd if-zero imaginary-part integer integer>fixnum integer>fixnum-strict integer? log2 log2-expects-positive log2-expects-positive? mod neg neg? next-float next-power-of-2 number number= number? numerator odd? power-of-2? prev-float ratio ratio? rational rational? real real-part real? recip rect> rem sgn shift sq times u< u<= u> u>= unless-zero unordered? when-zero zero? syn keyword factorKeyword 1sequence 2all? 2each 2each-from 2map 2map-as 2map-reduce 2reduce 2selector 2sequence 3append 3append-as 3each 3map 3map-as 3sequence 4sequence ?first ?last ?nth ?second ?set-nth accumulate accumulate! accumulate-as all? any? append append! append-as assert-sequence assert-sequence= assert-sequence? binary-reduce bounds-check bounds-check? bounds-error bounds-error? but-last but-last-slice cartesian-each cartesian-map cartesian-product change-nth check-slice clone-like collapse-slice collector collector-for concat concat-as copy count cut cut* cut-slice delete-all delete-slice drop-prefix each each-from each-index empty? exchange filter filter! filter-as find find-from find-index find-index-from find-last find-last-from first first2 first3 first4 flip follow fourth glue halves harvest head head* head-slice head-slice* head? if-empty immutable immutable-sequence immutable-sequence? immutable? index index-from indices infimum infimum-by insert-nth interleave iota iota-tuple iota-tuple? join join-as last last-index last-index-from length lengthen like longer longer? longest map map! map-as map-find map-find-last map-index map-index-as map-integers map-reduce map-sum max-length member-eq? member? midpoint@ min-length mismatch move new-like new-resizable new-sequence non-negative-integer-expected non-negative-integer-expected? nth nths pad-head pad-tail padding partition pop pop* prefix prepend prepend-as produce produce-as product push push-all push-either push-if reduce reduce-index reject reject! reject-as remove remove! remove-eq remove-eq! remove-nth remove-nth! repetition repetition? replace-slice replicate replicate-as rest rest-slice reverse reverse! reversed reversed? second selector selector-for sequence sequence-hashcode sequence= sequence? set-first set-fourth set-last set-length set-nth set-second set-third short shorten shorter shorter? shortest sift slice slice-error slice-error? slice? snip snip-slice subseq-start subseq-start-from subseq subseq? suffix suffix! sum sum-lengths supremum supremum-by surround tail tail* tail-slice tail-slice* tail? third trim trim-head trim-head-slice trim-slice trim-tail trim-tail-slice unclip unclip-last unclip-last-slice unclip-slice unless-empty virtual-exemplar virtual-sequence virtual-sequence? virtual@ when-empty syn keyword factorKeyword +@ change change-global counter dec get get-global get-namestack global inc init-namespaces initialize namespace off on set set-global set-namestack toggle with-global with-scope with-variable with-variables syn keyword factorKeyword 1array 2array 3array 4array >array array array? pair pair? resize-array