This commit is contained in:
parent
5ac5acd6d1
commit
b9b88d8fa0
10
list/list.go
10
list/list.go
@ -54,9 +54,6 @@ func (this *EmptyList) Conj(val any) IList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *List) Rest() IList {
|
func (this *List) Rest() IList {
|
||||||
if this == nil {
|
|
||||||
return emptyList
|
|
||||||
}
|
|
||||||
return this.next
|
return this.next
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,9 +62,6 @@ func (this *EmptyList) Rest() IList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *List) First() any {
|
func (this *List) First() any {
|
||||||
if this == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return this.Value
|
return this.Value
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,10 +82,6 @@ func (this *EmptyList) IsEmpty() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *List) String() string {
|
func (this *List) String() string {
|
||||||
if IsEmpty(this) {
|
|
||||||
return "()"
|
|
||||||
}
|
|
||||||
|
|
||||||
var sb strings.Builder
|
var sb strings.Builder
|
||||||
sb.WriteRune('(')
|
sb.WriteRune('(')
|
||||||
// Iterate and print elements
|
// Iterate and print elements
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user