我正在通過閱讀Maxima手冊進行學習。如何避免Maxima中的姓名衝突
Maxima有許多內置函數和全局變量。 我擔心覆蓋已存在的相同名稱函數或變量的可能性。
有沒有一種方便的方法可以避免Maxima中的名稱衝突?
我正在通過閱讀Maxima手冊進行學習。如何避免Maxima中的姓名衝突
Maxima有許多內置函數和全局變量。 我擔心覆蓋已存在的相同名稱函數或變量的可能性。
有沒有一種方便的方法可以避免Maxima中的名稱衝突?
如果你在談論命名空間, - 不,我從來沒有聽說過Maxima的命名空間。
爲您解決問題最簡單的方法是寫前綴用戶定義的變量和函數
另一種選擇是檢查功能\變量通過describe(FUNCTIONNAME)
已經存在。如果打印文本,不是功能是預定義=)
代碼示例:
a:1;
b:2;
map:3;
map(describe, values);
(%o25) 1
(%o26) 2
(%o27) 3
No exact match found for topic a.
Try ?? a (inexact match) instead.
No exact match found for topic b.
Try ?? b (inexact match) instead.
Function: map (<f>, <expr_1>, ..., <expr_n>)
Returns an expression whose leading operator is the same as that
....
....
There are also some inexact matches for map.
Try ?? map to see them.
(%o28) [false,false,true]
有一個experimantal包通過Robert Dodier
http://sourceforge.net/p/maxima/code/ci/master/tree/share/contrib/namespaces
(%i1) load("namespaces")$
(%i2) in_namespace(foo);
(%o2) #<PACKAGE "$FOO">
(%i3) z: 42;
(%o3) 42
(%i4) in_namespace(maxima)$
(%i5) z;
(%o5) z
(%i6) foo|z;
(%o6) 42
謝謝你了快速響應。那很好。 – 2014-10-05 09:01:48