This project has moved. For the latest updates, please go here.

Class Integer

superclass: Number;
instanceArchitecture: #Abstract

Page still under construction; sorry about that.

Instance Methods

	protocol: #binding method:
	[## valueIf: aCollection else: absentBlock
			"2
				valueIf: 
					{[3 + 4]. 
					[DateAndTime now]. 
					['Hello, world']} 
				else: ['Nobody here but us Smalltalkers']"
			
			"| dict | dict := Dictionary new. dict at: #red put: [3 + 4]. dict at: #green put: [DateAndTime now]. dict at: #blue put: ['Hello, world'].
			#green 
				valueIf: dict 
				else:  ['Nobody here but us Smalltalkers']"
			
			^aCollection metaValueAtIndex: self ifAbsent: absentBlock
	];
	
	protocol: #converting method:
	[## coerce: operand
		
		^operand asInteger
	]

Last edited Jun 6, 2014 at 7:26 AM by Strategesis, version 4