How much memory may a HPPL program use on a G2?
|
09-21-2023, 04:07 AM
Post: #82
|
|||
|
|||
RE: How much memory may a HPPL program use on a G2?
(09-18-2023 07:37 PM)komame Wrote: ⋮ Yes… in general. My immediate thought was to have REPLACE check for cases where optimized kernels could be employed — the relevant one here being a list of single-character replacement rules. Quote:Notice that you have to perform the replacement sequentially; you can’t replace all found values at once in a single iteration over the text string because they may overlap. This is connected to my second thought — what, exactly, would the semantics be for this more general REPLACE use? I was thinking that, whatever the general semantics would be, they could simplify down to the same meaning for when a list of single-character replacement rules is presented. That still doesn’t directly lead to an exact definition in the more general case. The on-the-face-of-it definition (for a more general REPLACE) would be to quickly fall back to the current REPLACE rule for strings: have the meaning of REPLACE(string,{a,b,…},{A,B,…}) be to invoke REPLACE with a->A, b->B, … (each in turn, each starting with the result of the previous) This would still allow a list of single-character replacement rules to be identified and more efficiently enacted. It is certainly possible different semantics might be better (useful in other cases). Just off the top of my head:
There are two aspects to keep in mind for a more general REPLACE: one being to allow for faster execution, another being to allow for shorter / simpler / more natural code. Quote:⋮ This sort of example popped right into my mind too, but mine was nowhere near as compact! And, again, we seem to be in agreement on the nature of interpreters! (Well, interpreter overhead — in this sort of case, to be more precise.) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 28 Guest(s)