Skip to content

Commit 043d917

Browse files
authored
Remove outdated lang package alias (#85)
Signed-off-by: James Hamlin <jfhamlin@gmail.com>
1 parent 82dc68f commit 043d917

File tree

20 files changed

+303
-308
lines changed

20 files changed

+303
-308
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test: vet $(TEST_TARGETS)
6464

6565
.PHONY: format
6666
format:
67-
@if go fmt ./... | grep -q .; then \
67+
@if go fmt ./... | grep -q ''; then \
6868
echo "Files were formatted. Please commit the changes."; \
6969
exit 1; \
7070
fi

pkg/glj/glj_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package glj
33
import (
44
"testing"
55

6-
value "github.com/glojurelang/glojure/pkg/lang"
6+
"github.com/glojurelang/glojure/pkg/lang"
77
)
88

99
func TestGLJ(t *testing.T) {
1010
mp := Var("glojure.core", "map")
1111
inc := Var("glojure.core", "inc")
12-
res := value.PrintString(mp.Invoke(inc, Read("[1 2 3]")))
12+
res := lang.PrintString(mp.Invoke(inc, Read("[1 2 3]")))
1313
if res != "(2 3 4)" {
1414
t.Errorf("Expected (2 3 4), got %v", res)
1515
}

pkg/glj/init.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ import (
66

77
// Add the Go standard library to the pkgmap.
88
_ "github.com/glojurelang/glojure/pkg/gen/gljimports"
9+
"github.com/glojurelang/glojure/pkg/lang"
910

10-
value "github.com/glojurelang/glojure/pkg/lang"
1111
"github.com/glojurelang/glojure/pkg/runtime"
1212
)
1313

1414
func init() {
1515
initEnv(os.Stdout)
1616
}
1717

18-
func initEnv(stdout io.Writer) value.Environment {
18+
func initEnv(stdout io.Writer) lang.Environment {
1919
// TODO: clean up this code. copied from rtcompat.go.
2020
kvs := make([]interface{}, 0, 3)
21-
for _, vr := range []*value.Var{value.VarCurrentNS, value.VarWarnOnReflection, value.VarUncheckedMath, value.VarDataReaders} {
21+
for _, vr := range []*lang.Var{lang.VarCurrentNS, lang.VarWarnOnReflection, lang.VarUncheckedMath, lang.VarDataReaders} {
2222
kvs = append(kvs, vr, vr.Deref())
2323
}
24-
value.PushThreadBindings(value.NewMap(kvs...))
24+
lang.PushThreadBindings(lang.NewMap(kvs...))
2525

2626
return runtime.NewEnvironment(runtime.WithStdout(stdout))
2727
}

pkg/glj/var.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package glj
22

3-
import value "github.com/glojurelang/glojure/pkg/lang"
3+
import "github.com/glojurelang/glojure/pkg/lang"
44

55
// Var returns an IFn associated with the namespace and name.
6-
func Var(ns, name interface{}) value.IFn {
7-
return value.InternVarName(asSym(ns), asSym(name))
6+
func Var(ns, name interface{}) lang.IFn {
7+
return lang.InternVarName(asSym(ns), asSym(name))
88
}
99

10-
func asSym(x interface{}) *value.Symbol {
10+
func asSym(x interface{}) *lang.Symbol {
1111
if str, ok := x.(string); ok {
12-
return value.NewSymbol(str)
12+
return lang.NewSymbol(str)
1313
}
14-
return x.(*value.Symbol)
14+
return x.(*lang.Symbol)
1515
}

pkg/lang/symbol.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (s *Symbol) Compare(other any) int {
5454
if !ok {
5555
panic(NewIllegalArgumentError(fmt.Sprintf("Cannot compare Symbol with %T", other)))
5656
}
57-
57+
5858
// Compare namespace first
5959
if s.ns != otherSym.ns {
6060
if s.ns == "" && otherSym.ns != "" {
@@ -67,7 +67,7 @@ func (s *Symbol) Compare(other any) int {
6767
return nsComp
6868
}
6969
}
70-
70+
7171
// Then compare name
7272
return strings.Compare(s.name, otherSym.name)
7373
}

pkg/lang/vector.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,17 @@ func (v *Vector) Compare(other any) int {
277277
if !ok {
278278
panic(NewIllegalArgumentError(fmt.Sprintf("Cannot compare Vector with %T", other)))
279279
}
280-
280+
281281
myCount := v.Count()
282282
otherCount := otherVec.Count()
283-
283+
284284
// Compare lengths first
285285
if myCount < otherCount {
286286
return -1
287287
} else if myCount > otherCount {
288288
return 1
289289
}
290-
290+
291291
// Compare element by element
292292
for i := 0; i < myCount; i++ {
293293
cmp := Compare(v.Nth(i), otherVec.Nth(i))

pkg/reader/clj_conformance_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,34 @@ import (
1414
"testing"
1515
"unicode"
1616

17-
value "github.com/glojurelang/glojure/pkg/lang"
17+
"github.com/glojurelang/glojure/pkg/lang"
1818
"github.com/kylelemons/godebug/diff"
1919
)
2020

2121
type (
2222
testSymbolResolver struct{}
2323
)
2424

25-
func (sr *testSymbolResolver) CurrentNS() *value.Symbol {
26-
return value.NewSymbol("user")
25+
func (sr *testSymbolResolver) CurrentNS() *lang.Symbol {
26+
return lang.NewSymbol("user")
2727
}
2828

29-
func (sr *testSymbolResolver) ResolveStruct(s *value.Symbol) *value.Symbol {
29+
func (sr *testSymbolResolver) ResolveStruct(s *lang.Symbol) *lang.Symbol {
3030
if strings.Contains(s.Name(), ".") {
3131
return s
3232
}
3333
return nil
3434
}
3535

36-
func (sr *testSymbolResolver) ResolveAlias(s *value.Symbol) *value.Symbol {
36+
func (sr *testSymbolResolver) ResolveAlias(s *lang.Symbol) *lang.Symbol {
3737
return s
3838
}
3939

40-
func (sr *testSymbolResolver) ResolveVar(s *value.Symbol) *value.Symbol {
40+
func (sr *testSymbolResolver) ResolveVar(s *lang.Symbol) *lang.Symbol {
4141
if strings.Contains(s.String(), "/") {
4242
return s
4343
}
44-
return value.NewSymbol("user/" + s.String())
44+
return lang.NewSymbol("user/" + s.String())
4545
}
4646

4747
// Running these fuzz tests is slow because clj is very slow to start

0 commit comments

Comments
 (0)