Maxima CAS 中的函数定义
Function definition in Maxima CAS
我有一个功能:
GiveBTree(z, depthMax):=block(
[ zz, t1, t2, tmp],
zz :[],
t1 :[z],
t2 :[],
tmp :[],
for depth : 1 thru depthMax step 1 do (
for z in t1 do (
tmp : Give2Preimages(z),
zz : append(tmp, zz),
t2 : append(tmp, t2)
)
tmp:[],
t1:t2
),
zz:flatten(zz),
return (zz)
)$
当我把它放入 Maxima 时,我有:
Maxima 5.43.2 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) GiveBTree(z, depthMax):=block(
[ zz, t1, t2, tmp],
zz :[],
t1 :[z],
t2 :[],
tmp :[],
Display all 2857 possibilities? (y or n)
JACOBI_CD
! JACOBI_CN
!! JACOBI_CS
# JACOBI_DC
$ JACOBI_DN
问题似乎是在 tmp 之后开始的。
所以我查了一下:
- 用谷歌搜索:maxima cas“显示全部”
- Maxima 函数索引
- 描述(tmp)
这个定义有什么问题?
我已经完成了罗伯特·多迪尔所说的步骤:
(%i2) load("g.mac");
(%o2) g.mac
所以问题是由“复制和粘贴”引起的。
我有一个功能:
GiveBTree(z, depthMax):=block(
[ zz, t1, t2, tmp],
zz :[],
t1 :[z],
t2 :[],
tmp :[],
for depth : 1 thru depthMax step 1 do (
for z in t1 do (
tmp : Give2Preimages(z),
zz : append(tmp, zz),
t2 : append(tmp, t2)
)
tmp:[],
t1:t2
),
zz:flatten(zz),
return (zz)
)$
当我把它放入 Maxima 时,我有:
Maxima 5.43.2 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) GiveBTree(z, depthMax):=block(
[ zz, t1, t2, tmp],
zz :[],
t1 :[z],
t2 :[],
tmp :[],
Display all 2857 possibilities? (y or n)
JACOBI_CD
! JACOBI_CN
!! JACOBI_CS
# JACOBI_DC
$ JACOBI_DN
问题似乎是在 tmp 之后开始的。
所以我查了一下:
- 用谷歌搜索:maxima cas“显示全部”
- Maxima 函数索引
- 描述(tmp)
这个定义有什么问题?
我已经完成了罗伯特·多迪尔所说的步骤:
(%i2) load("g.mac");
(%o2) g.mac
所以问题是由“复制和粘贴”引起的。