Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.maple > #352
| From | acer <maple@rogers.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.maple |
| Subject | Re: Prefix and Suffix Notation in Maple? |
| Date | 2012-02-06 22:49 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <28641422.1263.1328597399647.JavaMail.geo-discussion-forums@yqkc2> (permalink) |
| References | <4f30adeb$0$4049$4d5ecec7@news.xsusenet.com> <8339104.3663.1328596078039.JavaMail.geo-discussion-forums@vbuf18> |
Following up, the left-associativity of the &-operators makes using them to mimick postfix functional application appears to work OK. But it messes up for prefix functional application.
restart:
`&>`:=proc(a,b) a(b); end proc:
`&<`:=proc(a,b) b(a); end proc:
f:=t->sin(t)+t^3:
f&>4;
sin(4) + 64
13&<f;
sin(13) + 2197
g:=t->R(t):
g&>f&>4; # not useful
R(f)(4)
4&<f&<g; # ok
R(sin(4) + 64)
So, without right associativity this is not such a nice way to get the prefix functionality. Putting in brackets, as delimiters, ruins it as a "shortcut".
g&>(f&>4); # result is ok
R(sin(4) + 64)
I don't have any better suggestion, for the prefix shortcut. Maple's `not` is right associative and a module could export it (rebind it for interactive use). But alas, it is unary.
acer
Back to comp.soft-sys.math.maple | Previous | Next — Previous in thread | Find similar | Unroll thread
Prefix and Suffix Notation in Maple? "Dr. Giggleson" <hahaha@com.yahoo> - 2012-02-06 22:51 -0600
Re: Prefix and Suffix Notation in Maple? acer <maple@rogers.com> - 2012-02-06 22:27 -0800
Re: Prefix and Suffix Notation in Maple? acer <maple@rogers.com> - 2012-02-06 22:49 -0800
csiph-web