Carl Love

Carl Love

28050 Reputation

25 Badges

12 years, 335 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@taro Yes, there is another reason for it. As I explained elsewhere in this thread, there is a distinction between convert(x, string) and `convert/string`(x), only when x is a symbol. The distinction is whether the procedure `convert/string` gets called. The final result is only different when x is a symbol necessarily enclosed in backquotes; it will not be different when x is unnecessarily enclosed in backquotes.

n.d is not a symbol. It contains a special character (.), yet it is not enclosed in backquotes, therefore it's not a symbol. Indeed, n.d is the noncommutative multiplication of n and d.

@sand15 There is no synctactic equivalence between cmd1(..., subcmdA) and `cmd1/subcmdA`(...). However, there is a convention that for several older commands cmd1, that if the action of of cmd1(..., subcmdA) is mediated by a procedure, then that procedure's name is `cmd1/subcmdA`.When this is true for a particular command cmd1, that will be stated on the command's help page. This convention does indeed apply to convert, and there is a procedure named `convert/string`. The case convert(symbol, string) is very special: It is handled by the kernel rather than by that procedure. This surprised even me.

Nothing in the above paragraph is about tilde or map. There is a syntactic equivalence between map(x-> f(x, B), L) and map(f, L, B), (and the latter is more efficient). There is also a syntactic equivalence between map(f, L) and f~(L). Your error was conflating these two equivalences, making it appear as if the distinction was between tilde and map.

@taro Deleting a post which is not spam is a very rare and rarely needed operation. Why should more people have that power?

@taro Your symbol `N.D` contains a nonstandard character, the period, and so it must be enclosed in backquotes to be considered a symbol. On the other hand, Norman is a symbol already, so enclosing it in backquotes is redundant. In either case, the string result given can be parsed to recover the original symbol. See ?symbol.

@vv My first attempt at this would also have been string based. Because of the massive machinery of computer algebra at our disposal, I have a vague sense that there's an easier or better way. On the other hand, this is ultimately about the simplification of displays rather than expressions, and displays are string based.

So, with the ability to count occurences in strings, one could do a key sort of the RootOfs, or indeed of any of the subexpressions given by indets(..., anything), to determine the best candidates for aliasing. I'm writing on my phone right now (parked in a rest area waiting out a thunderstorm) without access to a computer with Maple.

@Axel Vogt often is a replacement for zip rather than map. Such is the case with all nine usages in this Question.

@Markiyan Hirnyk No, that was impossible this time, because the time that your Comment was posted was later than the time that I began typing my Answer. I always read all Replies and Answers that are posted before I begin entering my Reply or Answer.

I encourage you to repost your Answer in this thread. Information that appears in Replies is, as far as I know, not indexed, so it's impossible to find with a search. If you repost your Answer, then it'll be in a place where it can be found later.

Also, although I usually find your Answers adequate, I think that the one in question lacked sufficient clarity. This is partly due to, I believe, your tendency to copy-and-paste from 2-D to 1-D. This causes many changes, for example, I believe that A *~ B is changed to `~`[`*`](A, B). That isn't as clear.

@mmcdara And, just to be sure, you see that my use of indets and alias is not ad hoc and involves no copy-and-paste from solution to input, right?

Regarding the power of indets: There's no limit to the complexity of type expressions that one can create. See ?type,structured (and that page is just a start). These complex types have always worked for me with command type. However, I have made types complex enough that indets fails to find all subexpression of the type.

VV: It would be great to base whether to use an alias on the number of times that a subexpression occurs; however, it's not trivial to do that count.

@mmcdara Unfortunately, the documentation of this effect at ?restart is confusing and slightly incorrect. Your example is further proof of what I've been saying here for years: Contrary to what's said at ?restart, it's the separation by execution groups that matters, not the separation by lines. 

Yet I've seen many veteran users here routinely ignoring my advice.

@mmcdara You should never put a restart command in an execution group with any other command. The results of doing so are somewhat unpredictable. In this case, the result is that the interface command is ignored. Try again with the restart and interface commands in separate execution groups.

@vv Rather than entering the RootOfs manually and coming up with names for them, you can do this:

Rs:= indets(sols, RootOf):
alias(seq(R[k] = Rs[k], k= 1..nops(Rs)));
sols; #redisplay in compact form

@Mac Dude I only said "a year or so" because it seems like the administrators are only motivated to make about one update per year to the MaplePrimes code.

I guess that a lot of the spam comes from India. I have 2-1/2 reasons for thinking this:

  1. A lot of it is for non-web-based businesses in India, such as moving companies in specific cities.
  2. "Juriya," which appears as a suffix on a vast number of spammer's userames, is, I believe, a region in India. It's a vague region, I think, not something easy to look up like a city or state---kinda like we in the US would use "the Northeast".
  3. The relentless assault of spam begins precisely at midnight, Eastern Daylight Savings Times, and tapers off between 8 and 10 AM, Monday through Saturday. This must be a common work shift somewhere.

 

@vv Thank you. I was just trying to be dramatic to a humorous extent. I voted up your Question when I first read it.

I updated the code to work with eval's recurse option, and to prettyprint correctly when it returns unevaluated.

If you can think of some more interesting test cases, please test them. I do appreciate all testing of my code; I do tend to post quickly with inadequate testing.

An interesting situation is that eval itself, when it returns unevaluated, has a bound variable. For example, in Eval(f(x), x= a), x is a bound variable. The new eval works correctly with these bound variables, although I haven't yet updated the examples section of the Answer to show that.

@vv Okay, my procedure has been corrected, and I added your new example to the examples section.

Kitonum's solution also "fails" for eval('g(x)', x= 2*x), yet you gave his a vote up whereas mine is treated like a piece of trash to be kicked to the side of the road.

@emendes If L is a list, then <L> will print line by line. If L has more than 10 members, then you'll need to issue the command

interface(rtablesize= infinity);

You only need to issue this command once per session, and you can put it in an initialization file. You can replace infinity by any positive integer that you want to be the maximum number of lines to use.

First 386 387 388 389 390 391 392 Last Page 388 of 709