Currently not. I have been wondering what would be the best way to
cover this. We already have type(), but this only returns the basic
type. For example for list<number> and list<string> it returns the same
value. It can tell the difference between a list and an object, but not
between two objects from a different class.
You can use typename(), it will include the name of the class. However,
it is possible to have the same class name in two separate scripts,
since they are script-local by default. Thus this may make you think
it's the same class while it is not.
Using "instanceof" would work in many places, but you would need to
import the class to be able to use it. If you only want to know if two
objects are from the same class, that is extra overhead.
Perhaps we need a variant of type() that is specific about the exact
type. Then it can also be used to tell the difference between
list<number> and list<string>. This will be some work to implement,
because this will mean a new variable type.
--
hundred-and-one symptoms of being an internet addict:
20. When looking at a pageful of someone else's links, you notice all of them
are already highlighted in purple.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///