Changeset 4539 for lang/smalltalk
- Timestamp:
- 01/13/08 13:00:00 (10 months ago)
- Files:
-
- 1 modified
-
lang/smalltalk/misc/gost.st (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/smalltalk/misc/gost.st
r4472 r4539 1 1 #!gst 2 "===================================================================== 3 | 4 | GoST - A golf extension for GNU Smalltalk, much like Ruby's goruby. 5 | 6 | (tested on 2.3.6) 7 | 8 =====================================================================" 9 2 10 Object subclass: #Golf 3 11 instanceVariableNames: '' … … 12 20 add: $S -> Smalltalk; 13 21 add: $X -> thisContext; 22 add: $/ -> Character nl; 23 add: $\ -> nil; 14 24 yourself! 15 25 !Golf class methodsFor: 'golf'! … … 71 81 72 82 !CharacterArray methodsFor: 'golf'! 73 ?? o74 ^(o isClass ifTrue: [ o ] ifFalse: [ o class ]) ?? self!75 83 C 76 84 | s | … … 103 111 "*Experimental* e.g. 'Hello' >< {$H->$G. $l->$t} => 'Getto'" 104 112 ^d inject: self copy into: [:r :a| r replaceAll: a key with: a value ]! 113 displayOn: s 114 | j | 115 (j := Golf.Global at: $\) isNil 116 ifTrue: [ self do: [:x| x displayOn: s ] ] 117 ifFalse: [ self do: [:x| x displayOn: s ] separatedBy: [ j displayOn: s ] ]! 118 119 !! 120 121 !False methodsFor: 'golf'! 122 displayOn: s! 123 124 !UndefinedObject methodsFor: 'golf'! 125 displayOn: s! 105 126 106 127 !Number methodsFor: 'golf'! … … 127 148 128 149 !Boolean methodsFor: 'golf'! 150 doesNotUnderstand: m 151 ^[ super doesNotUnderstand: m copy ] ifError: [ ^m sendTo: self asCBooleanValue ]! 129 152 && b 130 153 ^self and: b! … … 177 200 178 201 179 " Not-so-golf Additions"202 "[ Not-so-golf Additions ]" 180 203 181 204 !Object methodsFor: 'rubylike-case'!
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)