Joe Riel

9660 Reputation

23 Badges

20 years, 14 days

MaplePrimes Activity


These are replies submitted by Joe Riel

You're pretty much out of luck.  With the mgrep utility you can get a complete list of all the _Env variables used in the library.

mgrep -c _Env maple.mla | grep -o '_Env[a-zA-Z0-9_]*' | sort -u > _Env

There are more than 600, most are not intended for the user.

Or use " ".

Or use " ".

I do not believe there is any packages that does this.

I had forgotten about ?StringTools[SearchAll]. You could use it in the following manner

charpos2 := proc(S :: string)
local char, p, pos;
uses ST = StringTools;
    pos := table();
    for char from "a" to "z" do
        # compute positions of char and uppercase char
        p := map2(op,1,[ST:-SearchAll([char,ST:-UpperCase(char)], S)]);
        if p <> [] then
            pos[char] := p;
        end if;
    end do;
    eval(pos);
end proc:

I had forgotten about ?StringTools[SearchAll]. You could use it in the following manner

charpos2 := proc(S :: string)
local char, p, pos;
uses ST = StringTools;
    pos := table();
    for char from "a" to "z" do
        # compute positions of char and uppercase char
        p := map2(op,1,[ST:-SearchAll([char,ST:-UpperCase(char)], S)]);
        if p <> [] then
            pos[char] := p;
        end if;
    end do;
    eval(pos);
end proc:

Here's my original suggestion, slightly modified and converted to a procedure.  It is intended to emulate the special evaluation rules of ?add, but provide multiple indexing. 

madd := proc(expr :: uneval, eq :: uneval)
local vars, rngs, i, n;
    vars := [lhs(eq)];
    rngs := eval([rhs(eq)]);
    n := nops(vars);
    if n <> nops(rngs) then
        error "variables, `%1', do not match ranges, `%2'", vars, rngs;
    end if;
    eval(subs('Add'=add, foldl('Add', 'expr', seq(vars[i]=rngs[i], i=1..n))));
end proc:
V := Array(1..4, i->i):
k := 23:  # this doesn't prevent the addition from working
madd(V[k]*j, (j,k) = ((1..4)$2));
                                                    100

 

Here's my original suggestion, slightly modified and converted to a procedure.  It is intended to emulate the special evaluation rules of ?add, but provide multiple indexing. 

madd := proc(expr :: uneval, eq :: uneval)
local vars, rngs, i, n;
    vars := [lhs(eq)];
    rngs := eval([rhs(eq)]);
    n := nops(vars);
    if n <> nops(rngs) then
        error "variables, `%1', do not match ranges, `%2'", vars, rngs;
    end if;
    eval(subs('Add'=add, foldl('Add', 'expr', seq(vars[i]=rngs[i], i=1..n))));
end proc:
V := Array(1..4, i->i):
k := 23:  # this doesn't prevent the addition from working
madd(V[k]*j, (j,k) = ((1..4)$2));
                                                    100

 

Generally, I like the separation.  However, there are cases---probaby dependent on my frustration level---where a brief example would clarify a convoluted description.  As you suggest, hyperlinks from the bullets to the examples (and from the Calling Sequence to the bullets) would be nice.  I don't believe that was doable with Maple's original help page viewer (the Classic interface), but may be with Standard. 

Generally, I like the separation.  However, there are cases---probaby dependent on my frustration level---where a brief example would clarify a convoluted description.  As you suggest, hyperlinks from the bullets to the examples (and from the Calling Sequence to the bullets) would be nice.  I don't believe that was doable with Maple's original help page viewer (the Classic interface), but may be with Standard. 

I agree with your thoughts on help pages---I've never liked the separate details page.  Maple's help pages can be created with sections collapsed, though that won't work with the command-line version (which is how I generally view help pages, albeit enhanced by Emacs; I could add a collapse feature to the Emacs maple help page viewer).

One aspect that I don't have a good solution for is the current separation of description and examples.  While I don't expect it to change, the separation of the description from the examples makes it harder to quickly comprehend a concept. I suspect that intermixing the two, if done carefully, could improve the quality of the documentation.  That is, a brief example could be given of a particular concept where it is introduced (in the description section).  As it is, I generally look first at the Calling Sequence, then search the Description section for the relevant parameter/form, then, if questions remain, look to the Examples section for the actual usage. 

I agree with your thoughts on help pages---I've never liked the separate details page.  Maple's help pages can be created with sections collapsed, though that won't work with the command-line version (which is how I generally view help pages, albeit enhanced by Emacs; I could add a collapse feature to the Emacs maple help page viewer).

One aspect that I don't have a good solution for is the current separation of description and examples.  While I don't expect it to change, the separation of the description from the examples makes it harder to quickly comprehend a concept. I suspect that intermixing the two, if done carefully, could improve the quality of the documentation.  That is, a brief example could be given of a particular concept where it is introduced (in the description section).  As it is, I generally look first at the Calling Sequence, then search the Description section for the relevant parameter/form, then, if questions remain, look to the Examples section for the actual usage. 

You could use the ?CurveFitting package to fit a smooth curve to the points.

You could use the ?CurveFitting package to fit a smooth curve to the points.

Thanks.  I suspected as much, but that form doesn't appear on the main ?plot page.

It seems a trifle strange that a Matrix works but not a two-dimensional Array (it plots, but not what is expected).  An Array is a more natural structure to hold data---Matrices seem better suited for LinearAlgebra operations. 

First 104 105 106 107 108 109 110 Last Page 106 of 195