-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatomizer.wxm
More file actions
34 lines (23 loc) · 932 Bytes
/
atomizer.wxm
File metadata and controls
34 lines (23 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 22.04.0 ] */
/* [wxMaxima: comment start ]
From https://www.informatik.uni-leipzig.de/~graebe/skripte/esr05.pdf page 43
[wxMaxima: comment end ] */
/* [wxMaxima: input start ] */
level1(u):=makelist(part(u,i),i,0,length(u));
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
structure(u):= if atom(u) then u else map(structure,level1(u));
/* [wxMaxima: input end ] */
/* [wxMaxima: comment start ]
The following is a different attempt
[wxMaxima: comment end ] */
/* [wxMaxima: input start ] */
extract_atoms(expr):=if atom(expr)
then [expr]
else if listp(expr)
then apply(append, map(extract_atoms, expr))
else []$
/* [wxMaxima: input end ] */
/* Old versions of Maxima abort on loading files that end in a comment. */
"Created with wxMaxima 22.04.0"$