Project

General

Profile

Bug #1403

RingID: remove this function?

Added by John Abbott over 4 years ago. Updated over 4 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Category:
enhancing/improving
Target version:
-
Start date:
24 Jan 2020
Due date:
% Done:

10%

Estimated time:
Spent time:

Description

Long completely fails to understand why this function should not be used.

Delete it?

History

#1 Updated by John Abbott over 4 years ago

Maybe we should change the doc to say that people should not normally us this function?

#2 Updated by John Abbott over 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Long insisted that if this function exists then there must also be a function which given the index would return the ring.
He was unwilling to accept the answer "No, there is no inverse function" (and nor is there likely to be one).

Since rings are first class values, they can be stored etc. just as easily as an index (indeed internally, a C++ ring object is just a (smart) pointer, so equivalent to an index). For some reason, Long wanted to use an index instead of a proper ring value -- the "smart" in the proper ring value lets CoCoALib delete it when it is no longer needed. If an index-to-ring function existed, it would never be possible to delete a ring... impractical! He was still insistent...

However, the fn could potentially be useful during debugging; though it is hard to image how it could be useful in normal code.

Perhaps the doc should simply say that the fn is present to help debugging?

Also available in: Atom PDF