Package objects are written using PACKAGEOBJECTDEF(...):
PACKAGEOBJECTDEF(...)
PACKAGEOBJECTDEF("p") := BLOCK( OBJECTDEF("M") )
This prints as:
package object p { object M }