dict-type.go: added MakeDict() constructor

This commit is contained in:
Celestino Amoroso 2024-06-10 09:35:48 +02:00
parent 5302907dcf
commit 54041552d4

View File

@ -12,6 +12,12 @@ import (
type DictType map[any]any type DictType map[any]any
func MakeDict() (dict *DictType) {
d := make(DictType)
dict = &d
return
}
func newDict(dictAny map[any]*term) (dict *DictType) { func newDict(dictAny map[any]*term) (dict *DictType) {
var d DictType var d DictType
if dictAny != nil { if dictAny != nil {
@ -124,7 +130,6 @@ func (dict *DictType) merge(second *DictType) {
} }
func (dict *DictType) setItem(key any, value any) (err error) { func (dict *DictType) setItem(key any, value any) (err error) {
(*dict)[key]=value (*dict)[key] = value
return return
} }