1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-22 06:13:32 +02:00

More fixes

This commit is contained in:
Divay Prakash
2018-10-27 16:17:59 +05:30
parent ec1111c156
commit 3e6ff8f257

View File

@@ -188,7 +188,7 @@ x := Random new next; yourself. x next. "random number strea
x := 100 atRandom. "quick random number" x := 100 atRandom. "quick random number"
``` ```
##Bitwise Manipulation: ## Bitwise Manipulation:
``` ```
| b x | | b x |
x := 16rFF bitAnd: 16r0F. "and bits" x := 16rFF bitAnd: 16r0F. "and bits"
@@ -381,7 +381,9 @@ y := x asSet. "convert string to s
y := x shuffled. "randomly shuffle string" y := x shuffled. "randomly shuffle string"
``` ```
## Array: Fixed length collection ## Array:
Fixed length collection
- ByteArray: Array limited to byte elements (0-255) - ByteArray: Array limited to byte elements (0-255)
- WordArray: Array limited to word elements (0-2^32) - WordArray: Array limited to word elements (0-2^32)
@@ -424,7 +426,9 @@ y := x asBag. "convert to bag coll
y := x asSet. "convert to set collection" y := x asSet. "convert to set collection"
``` ```
## OrderedCollection: acts like an expandable array ## OrderedCollection:
acts like an expandable array
``` ```
| b x y sum max | | b x y sum max |
x := OrderedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" x := OrderedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements"
@@ -616,7 +620,6 @@ y := x key.
y := x value. y := x value.
``` ```
## Dictionary:
## IdentityDictionary: ## IdentityDictionary:
uses identity test (== rather than =) uses identity test (== rather than =)