Message Boards Message Boards

0
|
1580 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

SOLVED: How to share reserved symbols across individual paclet.wl features?

Posted 8 months ago

(See Jason Bigg's suggested solution below)

My paclet consists of several stand-alone features, each in their own .wl file. But they all rely upon a common set of Reserved Symbols that are to be Protected so that their values cannot be changed.

Assume I collect all these reserved symbols into a ReservedSymbols.wl in the paclet directory . Is there an optional property in PacletInfo.wl that says "whatever paclet you load from here, ReservedSymbols.wl is automatically loaded first"? Or, is there a programmatic way for my other paclets to "include" and/or "import" ReservedSymbols.wl in their Begin["`Private`"] sections of their code?

POSTED BY: A. Chase Turner

Unless there is a nuance I am missing, you just have to call

Needs["MyPackage`ReservedSymbols`"]

inside the private portion of the other package files, and that will make every symbol in that context available in the present file, but will not make those symbols available to external users.

POSTED BY: Jason Biggs
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract