package - Maple Help

type/package

check for a Maple package Calling Sequence type(expr, 'package') Parameters

 expr - expression Description

 • The call type(expr, 'package') checks if expr is a Maple package. A Maple package is a module that has option package. For information on Maple packages, see module,package.
 • Not all modules are packages. Package semantics differ from module semantics in two ways. First, (module-based) package exports are automatically protected. Second, packages can be used as the first argument to with.
 • For historical reasons, type package also recognizes Maple tables and procedures with option package as packages. (The use of tables and procedures to implement packages in Maple is deprecated.) Examples

 > $\mathrm{type}\left(\mathrm{foo},'\mathrm{package}'\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(\mathrm{plots},'\mathrm{package}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\mathrm{Statistics},'\mathrm{package}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(\mathrm{LinearAlgebra},'\mathrm{package}'\right)$
 ${\mathrm{true}}$ (4)
 > $Q≔\mathbf{module}\left(\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{_export}\left(e,f\right);\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}e≔x→2*x-1;\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}f≔x→\mathrm{sin}\left(x\right)/\mathrm{cos}\left(x-1\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end module}:$
 > $\mathrm{type}\left(Q,'\mathrm{package}'\right)$
 ${\mathrm{false}}$ (5)
 > $P≔\mathbf{module}\left(\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{option}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{package};\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{_export}\left(e,f\right);\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}e≔x→2*x-1;\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}f≔x→\mathrm{sin}\left(x\right)/\mathrm{cos}\left(x-1\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end module}:$
 > $\mathrm{type}\left(P,'\mathrm{package}'\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{type}\left(\mathrm{Record}\left(a=2,b=3\right),'\mathrm{package}'\right)$
 ${\mathrm{false}}$ (7)
{"ft_lang_label":"__label__en","ft_lang_prob":0.5847053,"math_prob":0.9990577,"size":1171,"snap":"2022-40-2023-06","text_gpt3_token_len":328,"char_repetition_ratio":0.19965725,"word_repetition_ratio":0.06410257,"special_character_ratio":0.20153715,"punctuation_ratio":0.15584415,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99230456,"pos_list":[0,1,2,3,4,5,6,7,8,9,10],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-07T08:57:10Z\",\"WARC-Record-ID\":\"<urn:uuid:69c044dc-a7a7-4833-a91c-f0e7f6819da0>\",\"Content-Length\":\"176481\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:167bd192-96f5-4c0d-a0fc-ae7471f5e676>\",\"WARC-Concurrent-To\":\"<urn:uuid:a9aabf90-e2e6-4c53-b3aa-0c4388e56937>\",\"WARC-IP-Address\":\"199.71.183.28\",\"WARC-Target-URI\":\"https://www.maplesoft.com/support/help/AddOns/view.aspx?path=type%2Fpackage\",\"WARC-Payload-Digest\":\"sha1:VOSVZRAF4VISZGWT4LB3HIOZ7CNUVF4M\",\"WARC-Block-Digest\":\"sha1:5ULKSSONUKORNYPRTAB2OZQMT5ACKBKD\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500392.45_warc_CC-MAIN-20230207071302-20230207101302-00593.warc.gz\"}"}