-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add Enumerator class #801
base: master
Are you sure you want to change the base?
Conversation
@@ -1367,3 +1374,7 @@ func generateJSONFromPair(key string, v Object, t *Thread) string { | |||
|
|||
return out.String() | |||
} | |||
|
|||
func (h *HashObject) Enumerable() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method HashObject.Enumerable should have comment or be unexported
return out | ||
} | ||
|
||
//// Retrieves an object in an array using Integer index; common to `[]` and `at()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported method EnumeratorObject.Len should be of the form "Len ..."
GoMapClass = "GoMap" | ||
DecimalClass = "Decimal" | ||
BlockClass = "Block" | ||
ObjectClass = "Object" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported const ObjectClass should have comment (or a comment on this block) or be unexported
@@ -1817,3 +1823,7 @@ func (a *ArrayObject) unshift(objs []Object) *ArrayObject { | |||
a.Elements = append(objs, a.Elements...) | |||
return a | |||
} | |||
|
|||
func (a *ArrayObject) Enumerable() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method ArrayObject.Enumerable should have comment or be unexported
This is just for my interest regarding #342 .
This apparently works but is still not the real Enumerator class. Currently, only
Array#to_enum
,Hash#to_enum
,Enumerator#inspect
is available. (:each
is a fake😆)