Пример #1
0
/*
	returns a new *Object of the class named by 'klass' (Wrapper around NewInstance(types.NewName(...)))
*/
func (self *Environment) NewInstanceStr(klass string, params ...interface{}) (obj *Object, err error) {
	class, err := self.GetClass(types.NewName(klass))
	if err != nil {
		return
	}
	return self.NewInstance(class, params...)
}
Пример #2
0
/*
	returns the (potentially cached) types.Name of the class.
*/
func (self *Class) GetName(env *Environment) (name types.Name, err error) {
	//log.Printf("Name(miss)")
	var cstr string
	cstr, _, err = self.CallString(env, false, "getName")
	if err == nil {
		name = types.NewName(cstr)
	}
	return
}
Пример #3
0
// Wrapper around GetClass(types.NewName(...))
func (self *Environment) GetClassStr(klass string) (c *Class, err error) {
	class := types.NewName(klass)
	return self.GetClass(class)
}