Am Donnerstag, 18. Januar 2007 21:58 schrieb Matt Diephouse: > ~/Projects/parrot mdiep$ cat test.pir > .sub main :main > null $P0 > multi($P0) # should print "Any\n" > .end > > .sub multi :multi(String) > say "String" > .end > > .sub multi :multi(_) > say "Any" > .end > > ~/Projects/parrot mdiep$ parrot test.pir > Null PMC access in type()
While that was never actually specced, I do consider a NULL PMC as something like a null pointer in C. Any access (except testing for NULL-ness) to it is an error. Above example tests, that some usage of a NULL PMC fails. It's of course debatable, which usage of NULL should be allowed, e.g. above one. An explicit test in PMC->type conversion for PMCNULL in the MMD code is very likely all to make above code running (mmd.c:167,168). my 2¢ leo