File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414
1515class Path (Predefined ):
16- """
16+ r """
1717 <url>:WMA link:https://reference.wolfram.com/language/ref/Path.html</url>
1818
1919 <dl>
@@ -23,6 +23,13 @@ class Path(Predefined):
2323
2424 >> $Path
2525 = ...
26+
27+ '\$Path' used consulted in builtin functions <url>
28+ :\$Get:
29+ /doc/reference-of-built-in-symbols/inputoutput-files-and-filesystem/file-and-stream-operations/get/</url>, \
30+ and <url>
31+ :Needs:
32+ /doc/reference-of-built-in-symbols/inputoutput-files-and-filesystem/filesystem-operations/needs/</url> to resolve filenames, and to resolve contexts to file names.
2633 """
2734
2835 attributes = A_NO_ATTRIBUTES
Original file line number Diff line number Diff line change @@ -375,9 +375,28 @@ class Get(PrefixOperator):
375375 = Cos[x] + I Sin[x]
376376 S> DeleteFile[filename]
377377
378+ If the 'Path' is not fully qualified built-in variable <url>
379+ :\$Path:
380+ /doc/reference-of-built-in-symbols/directories-and-directory-operations/user-file-directories/$path/</url> is consulted.
381+
382+ 'Get' can also load packages:
383+ >> $ContextPath
384+ = ...
385+ S> << "VectorAnalysis`"
386+ = ...
387+
388+ If a package is loaded variable <url>
389+ :\$ContextPath:
390+ /doc/reference-of-built-in-symbols/scoping-constructs/$contextpath/</url> is updated with the new package context name:
391+ >> $ContextPath
392+ = ...
393+
394+ See also <url>
395+ :Needs:
396+ /doc/reference-of-built-in-symbols/inputoutput-files-and-filesystem/filesystem-operations/needs/</url>.
397+
398+
378399 ## TODO: Requires EndPackage implemented
379- ## 'Get' can also load packages:
380- ## >> << "VectorAnalysis`"
381400 """
382401
383402 eval_error = Builtin .generic_argument_error
Original file line number Diff line number Diff line change @@ -834,6 +834,21 @@ class Needs(Builtin):
834834 </dl>
835835
836836 >> Needs["VectorAnalysis`"]
837+
838+ In contrast to <url>
839+ :Get:
840+ /doc/reference-of-built-in-symbols/inputoutput-files-and-filesystem/file-and-stream-operations/get/</url>, \
841+ 'Needs' only loads a package if it has not already been loaded.
842+
843+ Like 'Get', <url>
844+ :\$ContextPath:
845+ /doc/reference-of-built-in-symbols/scoping-constructs/$contextpath/</url> is updated \
846+ when a new package context is added.
847+
848+ Builtin variable <url>
849+ :\$Path:
850+ /doc/reference-of-built-in-symbols/directories-and-directory-operations/user-file-directories/$path/</url> is used resolve the context to a file name.
851+
837852 """
838853
839854 messages = {
Original file line number Diff line number Diff line change @@ -316,6 +316,17 @@ class ContextPath_(Predefined):
316316 ## #> System`$ContextPath
317317 ## = {x`}
318318 ## #> $ContextPath = {"System`", "Global`"};
319+
320+ Functions <url>
321+ :Needs:
322+ /doc/reference-of-built-in-symbols/inputoutput-files-and-filesystem/filesystem-operations/needs/</url> and <url>
323+ :Get:
324+ /doc/reference-of-built-in-symbols/inputoutput-files-and-filesystem/file-and-stream-operations/get/</url>, \
325+ add to '\$ContextPath' when a new context is added.
326+
327+ See also Builtin variable <url>
328+ :\$Path:
329+ /doc/reference-of-built-in-symbols/directories-and-directory-operations/user-file-directories/$path/</url>.
319330 """
320331
321332 messages = {"cxlist" : "`1` is not a list of valid context names ending in `." }
You can’t perform that action at this time.
0 commit comments