Post Reply 
Programming puzzles: processing lists!
05-26-2017, 11:47 PM
Post: #97
RE: Programming puzzles: processing lists!
(05-26-2017 10:48 PM)John Keith Wrote:  ...LDDUP is faster than GoferList's Nub (5.3s vs. 6.2s on the list I tried) and returns the same result list.

Wish I could take credit for that! It's using a built-in ROM routine which is apparently nicely optimized.

(05-26-2017 10:48 PM)John Keith Wrote:  LSHF takes about 8.8s and about 0.4s for a list of 52 integers.

I could make that one faster, but I chose to stick with using the built-in RAND functions. This requires a couple of extra conversions between reals and BINTs (System Integers), but I figured it was better than me trying to come up with an acceptable alternative for a pseudo-random algorithm.

(05-26-2017 10:48 PM)John Keith Wrote:  There seems to be a bug in the LREPL function- it works properly when executed from the command line but does nothing when used in a program, e.g.:
\<< {10} {999} LREPL \>>

Hmmm... is there any possibility that this is one of those situations where the program has approximate numbers as targets and the source list has exact (or vice-versa)? Those wouldn't match, thus appearing as though it wasn't working. Otherwise I'm not sure what else might be happening, as I can't seem to replicate the issue. Any other details you can share would be greatly appreciated.

Thanks for testing this out, John! I'll try a few more tests with LREPL to see if I can get it to misbehave. For the moment, it seems to be working as expected for me. But I'm not assuming that I've tried every possible combination of things that might trip it up.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Programming puzzles: processing lists! - DavidM - 05-26-2017 11:47 PM

User(s) browsing this thread: 3 Guest(s)