This commit is contained in:
parent
3b4c206003
commit
8dd6fd958d
@ -69,10 +69,6 @@ func (this *EmptyList) First() any {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsEmpty(this IList) bool {
|
|
||||||
return this == nil || this.IsEmpty()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *List) IsEmpty() bool {
|
func (this *List) IsEmpty() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -86,7 +82,7 @@ func (this *List) String() string {
|
|||||||
sb.WriteRune('(')
|
sb.WriteRune('(')
|
||||||
// Iterate and print elements
|
// Iterate and print elements
|
||||||
var e IList
|
var e IList
|
||||||
for e = this; !IsEmpty(e); e = e.Rest() {
|
for e = this; !e.IsEmpty(); e = e.Rest() {
|
||||||
sb.WriteString(fmt.Sprint(e.First()))
|
sb.WriteString(fmt.Sprint(e.First()))
|
||||||
sb.WriteRune(' ')
|
sb.WriteRune(' ')
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user