Source File
list.go
Belonging Package
github.com/lann/ps
package ps
IsNil() bool
Head() Any
Tail() List
Size() int
ForEach(f func(Any))
Reverse() List
}
func () List {
return nilList
}
func ( *list) () bool {
return == nilList
}
func ( *list) () int {
return .depth
}
func ( *list) ( Any) List {
var list
.depth = .depth + 1
.value =
.tail =
return &
}
func ( *list) () Any {
if .IsNil() {
panic("Called Head() on an empty list")
}
return .value
}
func ( *list) () List {
if .IsNil() {
panic("Called Tail() on an empty list")
}
return .tail
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |