Rename a concept from placeholder to generic

This commit is contained in:
Nigel Tao committed 2018-05-14 15:04:16 +10:00
1 parent e0478b1d91
commit 56d46540b1
2 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -157,8 +157,8 @@ var Funcs = []string{
// avoid collision with a user-defined "T" type. // avoid collision with a user-defined "T" type.
const ( const (
PlaceholderOldName = t.IDCapitalT GenericOldName = t.IDCapitalT
PlaceholderNewName = t.IDDiamond GenericNewName = t.IDDiamond
) )
var SliceFuncs = []string{ var SliceFuncs = []string{
+4 -4
View File
@@ -91,7 +91,7 @@ func (c *Checker) builtInSliceFunc(qqid t.QQID) (*a.Func, error) {
return c.builtInSliceFuncs[qqid], nil return c.builtInSliceFuncs[qqid], nil
} }
func (c *Checker) parseBuiltInFuncs(ss []string, placeholder bool) (map[t.QQID]*a.Func, error) { func (c *Checker) parseBuiltInFuncs(ss []string, generic bool) (map[t.QQID]*a.Func, error) {
m := map[t.QQID]*a.Func{} m := map[t.QQID]*a.Func{}
buf := []byte(nil) buf := []byte(nil)
opts := parse.Options{ opts := parse.Options{
@@ -108,10 +108,10 @@ func (c *Checker) parseBuiltInFuncs(ss []string, placeholder bool) (map[t.QQID]*
if err != nil { if err != nil {
return nil, fmt.Errorf("check: could not tokenize built-in funcs: %v", err) return nil, fmt.Errorf("check: could not tokenize built-in funcs: %v", err)
} }
if placeholder { if generic {
for i := range tokens { for i := range tokens {
if tokens[i].ID == builtin.PlaceholderOldName { if tokens[i].ID == builtin.GenericOldName {
tokens[i].ID = builtin.PlaceholderNewName tokens[i].ID = builtin.GenericNewName
} }
} }
} }