[SOLVED] DSRN (dog slow roman numerals)
06-15-2014, 10:08 PM
Post: #42
 Claudio L. Senior Member Posts: 1,883 Joined: Dec 2013
RE: DSRN (dog slow roman numerals)
(06-15-2014 07:29 PM)Thomas Klemm Wrote:
(06-15-2014 06:48 PM)Claudio L. Wrote:  What would be a down side in your opinion?

In the case of string concatenation it is the commutative property: "a" + "b" ≠ "b" + "a"
For this operation another symbol should be used: . or ~ or ++ or whatever.

It's the same with concatenating lists. But it gets worse with the "addition" of an element to a list.
Why is { 1 2 3 } + 4 = { 1 2 3 4 } but { 5 6 7 } - 4 = { 1 2 3 }?
But then 4 + { 1 2 3 } = { 5 6 7 }.
And if you really want to add a number to each element you have to use ADD: { 1 2 3 } ADD 4 = { 5 6 7 }
I still think this was the worst decision when designing RPL.

Cheers
Thomas

We are on the same page, here. But that's not a downside of overloading operators, it's just a bad choice! newRPL already has the '+' operator working on lists by adding element by element. The ADD command will concatenate lists.
And for what is worth, I don't have a problem with making '+' fail for strings and have ADD or CONCAT, etc. to concatenate strings.

That's actually the beauty of overloading operators, you can make them do whatever you want.

Actually, thanks to "proper" overloading of the '+' operators for lists, doing things like MAP, with nested lists is a breeze, just apply the same '+' operator recursively to all elements, whether they are lists or not. It's already done and working fine. The resulting code is surprisingly clean, so I was wondering what the downsides are (I'm still wondering).

Claudio
 « Next Oldest | Next Newest »

 Messages In This Thread [SOLVED] DSRN (dog slow roman numerals) - HP67 - 06-11-2014, 05:20 PM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-11-2014, 06:58 PM RE: DSRN (dog slow roman numerals) - HP67 - 06-11-2014, 07:06 PM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-11-2014, 07:51 PM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-11-2014, 08:23 PM RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 11:44 AM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-12-2014, 12:23 PM RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 04:49 PM RE: DSRN (dog slow roman numerals) - HP67 - 06-15-2014, 12:02 PM RE: DSRN (dog slow roman numerals) - Claudio L. - 06-15-2014, 06:28 PM RE: DSRN (dog slow roman numerals) - Massimo Gnerucci - 06-15-2014, 06:33 PM RE: DSRN (dog slow roman numerals) - Claudio L. - 06-15-2014, 06:38 PM RE: DSRN (dog slow roman numerals) - Claudio L. - 06-15-2014, 06:48 PM RE: DSRN (dog slow roman numerals) - HP67 - 06-16-2014, 06:09 AM RE: DSRN (dog slow roman numerals) - Claudio L. - 06-16-2014, 12:20 PM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-12-2014, 01:48 PM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-12-2014, 01:53 PM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-12-2014, 02:04 PM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-12-2014, 02:49 PM RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 05:46 PM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-12-2014, 09:17 PM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-12-2014, 09:49 PM RE: DSRN (dog slow roman numerals) - DavidM - 06-13-2014, 01:01 AM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-13-2014, 08:12 AM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-13-2014, 11:19 AM RE: DSRN (dog slow roman numerals) - DavidM - 06-13-2014, 05:15 PM RE: DSRN (dog slow roman numerals) - rprosperi - 06-13-2014, 05:40 PM RE: DSRN (dog slow roman numerals) - DavidM - 06-13-2014, 07:36 PM RE: DSRN (dog slow roman numerals) - Claudio L. - 06-15-2014, 01:22 AM RE: DSRN (dog slow roman numerals) - Claudio L. - 06-15-2014, 12:03 PM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-13-2014, 09:14 PM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-14-2014, 12:38 AM RE: DSRN (dog slow roman numerals) - kakima - 06-14-2014, 02:27 AM RE: DSRN (dog slow roman numerals) - DavidM - 06-14-2014, 05:04 PM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-14-2014, 07:36 AM RE: DSRN (dog slow roman numerals) - DavidM - 06-14-2014, 06:00 PM RE: DSRN (dog slow roman numerals) - Dave Britten - 06-15-2014, 02:58 AM RE: DSRN (dog slow roman numerals) - kakima - 06-15-2014, 02:32 AM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-15-2014, 04:30 AM RE: DSRN (dog slow roman numerals) - Claudio L. - 06-15-2014, 11:49 AM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-15-2014, 07:29 PM RE: DSRN (dog slow roman numerals) - kakima - 06-15-2014, 09:55 PM RE: DSRN (dog slow roman numerals) - Claudio L. - 06-15-2014 10:08 PM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-15-2014, 09:30 PM RE: DSRN (dog slow roman numerals) - DavidM - 06-16-2014, 03:40 AM RE: DSRN (dog slow roman numerals) - Claudio L. - 06-16-2014, 04:24 AM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-15-2014, 10:13 PM RE: DSRN (dog slow roman numerals) - kakima - 06-16-2014, 04:45 AM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-16-2014, 05:07 AM RE: DSRN (dog slow roman numerals) - DavidM - 06-16-2014, 03:42 PM RE: DSRN (dog slow roman numerals) - Thomas Klemm - 06-16-2014, 09:13 PM

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