June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1,5 +1,11 @@
// Creates and initializes a new Array
// Constant array
var intArray := (1, 2, 3, 4, 5).
// Generic array
var stringArr := Array new:5.
stringArr[0] := "string".
// Typified array
Array<literal> arr := V<literal>(5).
arr[0] := "a".
arr[1] := "b".

View file

@ -1,5 +1,5 @@
//Create and initialize ArrayList
var myAl := ArrayList new; append:"Hello"; append:"World"; append:"!".
var myAl := system'collections'ArrayList new; append:"Hello"; append:"World"; append:"!".
//Create and initialize List
var myList := List new; append:"Hello"; append:"World"; append:"!".
var myList := system'collections'List new; append:"Hello"; append:"World"; append:"!".

View file

@ -1,4 +1,4 @@
//Create a dictionary
var dict := Dictionary new.
var dict := system'collections'Dictionary new.
dict["Hello"] := "World".
dict["Key"] := "Value".

View file

@ -0,0 +1,10 @@
Public Sub Main()
Dim siCount As Short
Dim cCollection As Collection = ["0": "zero", "1": "one", "2": "two", "3": "three", "4": "four",
"5": "five", "6": "six", "7": "seven", "8": "eight", "9": "nine"]
For siCount = 0 To 9
Print cCollection[Str(siCount)]
Next
End

View file

@ -0,0 +1,9 @@
julia> collection = []
0-element Array{Any,1}
julia> push!(collection, 1,2,4,7)
4-element Array{Any,1}:
1
2
4
7

View file

@ -1,2 +1,3 @@
class Something { has $.foo; has $.bar };
my $obj = Something.new: foo => 1, bar => 2;
my $newobj = $obj but role { has $.baz = 3 } # anonymous mixin