Skip to content
This repository has been archived by the owner on Jun 20, 2021. It is now read-only.

Added more blocks to the List module #39

Merged
merged 2 commits into from
Oct 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions modules/simple/core/List.sim
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,19 @@ class List : Object
__OBJECT + arr[a]
end
return __OBJECT

/* Returns the first element of the List */

block first()
return __OBJECT[0]
end

/* Returns the last element in the List */

block last()
return __OBJECT[lengthOf(__OBJECT)]
end

/*
* Error block, needs to be private
* So it won't be be accessed outside
Expand Down