Skip to content

[REF] Change interfaces using tapeId to reference of tape#178

Open
TimSiebert1 wants to merge 3 commits intomasterfrom
use-ptr-for-id
Open

[REF] Change interfaces using tapeId to reference of tape#178
TimSiebert1 wants to merge 3 commits intomasterfrom
use-ptr-for-id

Conversation

@TimSiebert1
Copy link
Copy Markdown
Collaborator

@TimSiebert1 TimSiebert1 commented Feb 11, 2026

This PR changes the methods that rely on tapeId to select a tape from a global buffer to use a reference to the tape directly. The tape_interface methods are adapted accordingly and the global tapeBuffer is removed.

As proposed and discussed with @osander1

  • Adapt the docstrings
  • Adapt latex docs

This PR changes the methods that rely on tapeId to select a tape from a global buffer to use
a reference to the tape directly. The tape_interface methods are adapted accordingly and the global
tapeBuffer is removed.
@osander1
Copy link
Copy Markdown
Contributor

That's pretty radical. It was thinking that this change can be made in a backward-compatible way:

  • Keep the old methods, let them look for the tape by id, and then forward to the new methods.
  • Operator overloading should allow to have the old and new interfaces side-by-side.
  • In the constructor of ValueTape, create an id by hashing the pointer value
  • Eventually, deprecate the old interface using [[deprecated]]

Also, I am not convinced that suffixing everything with Ptr makes the code more readable. But that's a matter of taste.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants