the last grand rename

This commit is contained in:
Andrey Parhomenko 2024-05-19 23:19:55 +05:00
parent c280608f8d
commit 1ba2779261
12 changed files with 35 additions and 31 deletions

3
btest.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
#
go build -o ./exe/ ./cmd/*

View file

@ -2,7 +2,7 @@ package main
import (
"fmt"
"vultras.su/core/gods/lists"
"surdeus.su/core/gods/lists"
"strings"
)

View file

@ -1,7 +1,7 @@
package main
import (
"vultras.su/core/gods/maps"
"surdeus.su/core/gods/maps"
"fmt"
)

4
go.mod
View file

@ -1,5 +1,5 @@
module vultras.su/core/gods
module surdeus.su/core/gods
go 1.21
require golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect
require golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb

View file

@ -1,4 +1,4 @@
package iterx
package iters
// The type describes pair of key and value.
type Pair[K any, V any] struct {

View file

@ -1,4 +1,4 @@
package iterx
package iters
// Implementing the interface lets us iterate through the
// the data by lightweight channels.

View file

@ -1,4 +1,4 @@
package iterx
package iters
func ChanToSlice[V any](c chan V) []V {
ret := []V{}

View file

@ -1,8 +1,8 @@
package lists
import (
"vultras.su/core/gods"
"vultras.su/core/gods/stacks"
"surdeus.su/core/gods"
"surdeus.su/core/gods/stacks"
)
// The interface all the lists must implement.

View file

@ -1,7 +1,7 @@
package lists
import (
"vultras.su/core/gods"
"surdeus.su/core/gods"
"sort"
"fmt"
)

View file

@ -2,7 +2,7 @@ package maps
import (
"fmt"
"vultras.su/core/gods"
"surdeus.su/core/gods"
)
// Generic map interface for all the maps.

View file

@ -1,7 +1,7 @@
package rangex
package ranges
import (
"github.com/mojosa-software/godat/src/iterx"
"surdeus.su/core/gods/iters"
cnts "golang.org/x/exp/constraints"
)
@ -18,29 +18,30 @@ func New[V cnts.Ordered](start, step, end V) *Range[V] {
}
}
func (r *Range[V]) Chan() iterx.PairChan[int, V] {
start, step, end := r.start, r.step, r.end
c := make(iterx.PairChan[int, V])
go func(){
var compare func(a, b V) bool
func (r *Range[V]) Chan() iters.PairChan[int, V] {
less := func(a, b V) bool {
return a < b
}
more := func(a, b V) bool {
return a > b
}
var compare func(a, b V) bool
start, step, end := r.start, r.step, r.end
if start < end {
compare = less
} else {
compare = more
}
c := make(iters.PairChan[int, V])
go func(){
j := 0
for i := start ; compare(i, end) ; i += step {
c <- iterx.Pair[int, V]{
c <- iters.Pair[int, V]{
K:j,
V:i,
}

View file

@ -1,7 +1,7 @@
package stacks
import (
"vultras.su/core/gods"
"surdeus.su/core/gods"
)
type Stack[V any] interface {