In Raku, what is the "Node" type or distinguished value?

Viewed 91

I've been unable to find any description or documentation using web and Raku doc search. But Node is referenced as a type in the top answer to the question How to keep Nil from reverting container to its default value? and based on the description in that answer, the Node type / value would be useful to me.

Note that this has nothing to do with Node.js! (Except that I get a lot of irrelevant search results.)

1 Answers

I am on the same page as you - this answer sent me to search for 'Node' in the raku docs. Then I gathered that the 'Node' in question is the class defined in the original question. Any raku class can be instantiated as a type object (docs.raku.org/language/classtut#index-entry-type_object ) or as an instance object. The way I think about this is that the type object is an empty ("undefined") instance that can still access any class variables. So it's a perfect, type consistent, candidate for an 'empty' sentinel for this example...

Related