A call to which foo returns the path to the executable class constructor:
which foo
fldr_2/@foo/foo.m
A function and a package can have the same name. However, a package name by itself is
not an identifier. Therefore, if a redundant name occurs alone, it identifies the function.
Executing a package name alone returns an error.
Package Functions vs. Static Methods
In cases where a package and a class have the same name, a static method takes
precedence over a package function. For example, path folder fldrA contains a package
function and path folder fldrB contains a class static method:
fldrA/+foo/bar.m % bar is a function in package foo
fldrB/@foo/bar.m % bar is a static method of class foo
A call to which foo.bar returns the path to the static method:
which foo.bar
fldrB/@foo/bar.m
In cases where the same path folder contains both package and class folders with the
same name, the class static method takes precedence over the package function.
fldr/@foo/bar.m % bar is a static method of class foo
fldr/+foo/bar.m % bar is a function in package foo
A call to which foo.bar returns the path to the static method:
which foo.bar
fldr/@foo/bar.m
See Also
More About
- “Folders Containing Class Definitions” on page 6-17
- “Class Precedence” on page 6-23
See Also