renamed array and hash to list and dictionary

Since these are not the ruby classes, we don’t need
the old names. They are misleading.
An Array is a military term, we mean list
And a Hash is an implementation of a Dictionary,
or LookupTable
This commit is contained in:
Torsten Ruger
2015-05-12 19:10:45 +03:00
parent a94ce51c58
commit dd41758dea
10 changed files with 21 additions and 21 deletions

View File

@ -19,7 +19,7 @@ And thus parfait can be used at run-time.
It's too simple: just slips off the mind like a fish into water.
Parfait has a brother, the Builtin module. Builtin contains everything that can not be coded in ruby,
but we still need (things like array access).
but we still need (things like List access).
#### Example: Message send

View File

@ -1,10 +1,10 @@
# almost simplest hash imaginable. make good use of arrays
# almost simplest hash imaginable. make good use of Lists
module Parfait
class Hash < Object
class Dictionary < Object
def initialize
@keys = Array.new_object()
@values = Array.new_object()
@keys = List.new_object()
@values = List.new_object()
end
def values()
@values

View File

@ -14,8 +14,8 @@
# In other words, the Layout is a list of names that describe
# the values stored in an actual object.
# The object is an array of values of length n and
# the Layout is an array of names of length n
# The object is an List of values of length n and
# the Layout is an List of names of length n
# Together they turn the object into a hash like structure
module Parfait

View File

@ -1,10 +1,10 @@
module Parfait
class Array < Object
class List < Object
# push means add to the end
# this automatically grows the array
# this automatically grows the List
def push value
self.set( length , value)
end
@ -40,7 +40,7 @@ module Parfait
index += 1
end
end
#many basic array functions can not be defined in ruby, such as
#many basic List functions can not be defined in ruby, such as
# get/set/length/add/delete
# so they must be defined as CompiledMethods in Builtin::Kernel

View File

@ -15,7 +15,7 @@ module Parfait
# it is a collection of objects, some of which are data, some classes, some functions
# The main entry is a function called (of all things) "main", This _must be supplied by the compling
# There is a start and exit block that call main, which receives an array of strings
# There is a start and exit block that call main, which receives an List of strings
# While data ususally would live in a .data section, we may also "inline" it into the code
# in an oo system all data is represented as objects
@ -24,7 +24,7 @@ module Parfait
def initialize
super()
@classes = Parfait::Hash.new_object
@classes = Parfait::Dictionary.new_object
#global objects (data)
@objects = []
@symbols = []