translated slava's old example to work with the latest objc vocabs

darcs
lypanov 2006-11-18 14:08:04 +00:00
parent 08550f3a7d
commit 950e6d40ba
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
! Copyright (C) 2006 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
IN: cocoa-speech
USING: cocoa objc objc-classes kernel ;
"NSSpeechSynthesizer" f import-objc-class
: say ( string -- )
NSSpeechSynthesizer -> alloc f -> initWithVoice: swap <NSString> -> startSpeakingString: ;
"Hello from Factor" say