PreviousUpNext

15.4.586  src/lib/compiler/front/semantic/pickle/symbol-and-picklehash-pickling.pkg

## symbol-and-picklehash-pickling.pkg

# Compiled by:
#     src/lib/compiler/core.sublib



stipulate
    package ph  =  picklehash;                                                          # picklehash                            is from   src/lib/compiler/front/basics/map/picklehash.pkg
    package pkr =  pickler;                                                             # pickler                               is from   src/lib/compiler/src/library/pickler.pkg
    package sy  =  symbol;                                                              # symbol                                is from   src/lib/compiler/front/basics/map/symbol.pkg
    package tag =  pickler_datatype_tags;                                               # pickler_datatype_tags                 is from   src/lib/compiler/src/library/pickler-datatype-tags.pkg
herein

    package   symbol_and_picklehash_pickling
    :         Symbol_And_Picklehash_Pickling                                            # Symbol_And_Picklehash_Pickling        is from   src/lib/compiler/front/semantic/pickle/symbol-and-picklehash-pickling.api
    { 
        fun wrap_symbol s
            =
            {   mknod =   pkr::make_funtree_node  tag::symbol;

                namespace
                    =
                    case (sy::name_space s)
                        #                      
                        sy::VALUE_NAMESPACE          => "a";
                        sy::TYPE_NAMESPACE           => "b";
                        sy::API_NAMESPACE            => "c";
                        sy::PACKAGE_NAMESPACE        => "d";
                        sy::GENERIC_NAMESPACE        => "e";
                        sy::GENERIC_API_NAMESPACE    => "f";
                        sy::FIXITY_NAMESPACE         => "g";
                        sy::LABEL_NAMESPACE          => "h";
                        sy::TYPE_VARIABLE_NAMESPACE  => "i";
                    esac;

                mknod  namespace  [pkr::wrap_string (sy::name s)];
            };



        fun wrap_picklehash  picklehash
            =
            {   mknod =   pkr::make_funtree_node   tag::picklehash;

                mknod  "p"  [pkr::wrap_string (byte::bytes_to_string (ph::to_bytes picklehash))];
            };
    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext