refactor objects
This commit is contained in:
@@ -18,10 +18,15 @@ func (i Integer) Inspect() string {
|
||||
return fmt.Sprintf("%d", i.Value)
|
||||
}
|
||||
|
||||
func (i Integer) Clone() Object {
|
||||
func (i Integer) Copy() Object {
|
||||
return Integer{Value: i.Value}
|
||||
}
|
||||
|
||||
// Hash implements the Hasher interface
|
||||
func (i Integer) Hash() HashKey {
|
||||
return HashKey{Type: i.Type(), Value: uint64(i.Value)}
|
||||
}
|
||||
|
||||
func (i Integer) String() string {
|
||||
return i.Inspect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user