acer

32333 Reputation

29 Badges

19 years, 323 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Round-brackets also provide for some distinct aspects of rtable selection/subindexing.

While it's unfortunate that some help-pages themselves inadequately cover the functionality of their topic commands, it can be more unfortunate if relevant help-pages are missing adequate cross-referencing or are too hard to find.

For example, there should be better cross-referencing from ?Matrix, ?Vector, and ?rtable to ?selection and ?rtable_indexing. I will submit an SCR for that.

acer

Round-brackets also provide for some distinct aspects of rtable selection/subindexing.

While it's unfortunate that some help-pages themselves inadequately cover the functionality of their topic commands, it can be more unfortunate if relevant help-pages are missing adequate cross-referencing or are too hard to find.

For example, there should be better cross-referencing from ?Matrix, ?Vector, and ?rtable to ?selection and ?rtable_indexing. I will submit an SCR for that.

acer

1) vertical bars around a name don't act as quotes.

2) See the help-page on concatenation.

3) Read the manuals, in general.

As for this other thread,

4) For an lowercase array (or table) use evalm to see its contents. See the last_name_eval help-page.

5) Use Array instead of array, since the latter is deprecated.

acer

1) vertical bars around a name don't act as quotes.

2) See the help-page on concatenation.

3) Read the manuals, in general.

As for this other thread,

4) For an lowercase array (or table) use evalm to see its contents. See the last_name_eval help-page.

5) Use Array instead of array, since the latter is deprecated.

acer

And yet it seems a safe bet that you have gotten there by luck and exhaustive search. True understanding will serve you better in the long run. Hence I suggest a good read of the relevant manual pages.

Note that in your code fragment, the last || and `` don't accomplish much of anything; they just append `` (empty name) to the end.

> for i from 1 to 3 do
>   i, `a_`||i
> end do;
                                    1, a_1
 
                                    2, a_2
 
                                    3, a_3

acer

And yet it seems a safe bet that you have gotten there by luck and exhaustive search. True understanding will serve you better in the long run. Hence I suggest a good read of the relevant manual pages.

Note that in your code fragment, the last || and `` don't accomplish much of anything; they just append `` (empty name) to the end.

> for i from 1 to 3 do
>   i, `a_`||i
> end do;
                                    1, a_1
 
                                    2, a_2
 
                                    3, a_3

acer

It's often better to ask separate (entirely more general) questions in a new thread. That way both topics and their answers are less confusing.

Exporting as a Maplet does nothing except save the code to a file with extension .maplet. It won't actually be a Maplet, or ever cause a Maplet to be run, unless the code you first write uses the routines in the Maplets package.

acer

It's often better to ask separate (entirely more general) questions in a new thread. That way both topics and their answers are less confusing.

Exporting as a Maplet does nothing except save the code to a file with extension .maplet. It won't actually be a Maplet, or ever cause a Maplet to be run, unless the code you first write uses the routines in the Maplets package.

acer

Sure. But what you write about "fixed, local" locations is also true of libname and .mla Library archives. (BTW, one could also save the Maplet, inside a launching proc, to a Library archive, and then call from any new session.)

The request to attach, somehow, a maplet to the GUI menus without having it point at a fixed location (of either .maplet or .mla file) seems odd to me. What, precisely, would it be stored as/by/to?

acer

Sure. But what you write about "fixed, local" locations is also true of libname and .mla Library archives. (BTW, one could also save the Maplet, inside a launching proc, to a Library archive, and then call from any new session.)

The request to attach, somehow, a maplet to the GUI menus without having it point at a fixed location (of either .maplet or .mla file) seems odd to me. What, precisely, would it be stored as/by/to?

acer

The ?comment help-page read from the Standard GUI of Maple 13 mentions the use of multi-line comments. The ?comment help-page available in the commandline (and Classic?) interfaces does not mention it.

Setting up one's Maple prompt to be the empty comment (**) in the commandline interface is neat. It allows one to copy the entire text of input including the prompt and then insert it as runnable code.

As noted in ?comment, the pasting will only work properly in 1D Maple input mode. It works handlily for inserting into the commandline interface, or into a Worksheet with 1D Maple input mode in Standard.

My Linux ~/.mapleinit file now contains,

interface(prompt=" (**) "):

One could also put that inside a conditional using IsWorksheetInterface(), to get it in commandline but not in Standard.

Someone pointed out to me that it is also documented in ?include in Maple 12, where it also appears to work. (Your mileage may vary.)

acer

Doug, do you mean the ability to insert such a Button programmatically?

In general, there is no functionality at present to insert any kind of Component programmatically, for any purpose, AFAIK. There would be a great deal of usefulness to such functionality, and I believe that it's been discussed here before.

But you should be able to insert a Button Component "by hand" (using the mouse pointer and palette) and then edit the "Action when Clicked" to issue read "foo.maplet". You likely already realize this. Redirecting results returned by the Maplet would be more work, of course.

What happens on Windows if you File->Open a foo.maplet file? On Linux, where there is no MapletViewer, it simpply inserts the file's contents.  On Windows, can you Open or Launch from the File menu?  The File->Open manager does allow filtering by .maplet filename extension.

If there were a way to get a context-sentive menu action to run a Maplet (and behave nicely when returning NULL) when right-clicking on the "empty region" (where the cursor lies), then one could write code to automatically add reading file foo.maplet to the context-menus. I haven't really tried this. I've had difficulty getting a context-menu action to %CANCEL and insert nothing (not even NULL) after launching say a Worksheet/Help.

acer

Doug, do you mean the ability to insert such a Button programmatically?

In general, there is no functionality at present to insert any kind of Component programmatically, for any purpose, AFAIK. There would be a great deal of usefulness to such functionality, and I believe that it's been discussed here before.

But you should be able to insert a Button Component "by hand" (using the mouse pointer and palette) and then edit the "Action when Clicked" to issue read "foo.maplet". You likely already realize this. Redirecting results returned by the Maplet would be more work, of course.

What happens on Windows if you File->Open a foo.maplet file? On Linux, where there is no MapletViewer, it simpply inserts the file's contents.  On Windows, can you Open or Launch from the File menu?  The File->Open manager does allow filtering by .maplet filename extension.

If there were a way to get a context-sentive menu action to run a Maplet (and behave nicely when returning NULL) when right-clicking on the "empty region" (where the cursor lies), then one could write code to automatically add reading file foo.maplet to the context-menus. I haven't really tried this. I've had difficulty getting a context-menu action to %CANCEL and insert nothing (not even NULL) after launching say a Worksheet/Help.

acer

I doubt that you'd want "all" possible computations done modulo 26. There's a lot more to "all" than you might at first imagine.

Maybe you mean interactive arithmetic, or something like that. You should be able to extend this simplistic example code below to cover other arithmetic operators (as described in the ?mod help-page).

> modenv := module() export `+`,`-`,use_p;
>    option package;
>    local p;
>    use_p := proc(x::posint) p:=x; end proc;
>    `+` := proc(a,b) (a+b) mod p; end proc;
>    `-` := proc(a) :-`-`(a) mod p; end proc;
> end module:

> with(modenv):
> use_p(26):

> 7+24;
                                       5
 
> -24;
                                       2
 
> 3-24;
                                       5

There may well be some tricky syntax corners, possibly where the global operators like :-`+` would still be wanted.

acer

I doubt that you'd want "all" possible computations done modulo 26. There's a lot more to "all" than you might at first imagine.

Maybe you mean interactive arithmetic, or something like that. You should be able to extend this simplistic example code below to cover other arithmetic operators (as described in the ?mod help-page).

> modenv := module() export `+`,`-`,use_p;
>    option package;
>    local p;
>    use_p := proc(x::posint) p:=x; end proc;
>    `+` := proc(a,b) (a+b) mod p; end proc;
>    `-` := proc(a) :-`-`(a) mod p; end proc;
> end module:

> with(modenv):
> use_p(26):

> 7+24;
                                       5
 
> -24;
                                       2
 
> 3-24;
                                       5

There may well be some tricky syntax corners, possibly where the global operators like :-`+` would still be wanted.

acer

First 477 478 479 480 481 482 483 Last Page 479 of 591