Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a Lent[T] shim for the lent type and use it in the results module #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zah
Copy link
Contributor

@zah zah commented Sep 24, 2021

No description provided.

@arnetheduck
Copy link
Member

it's a bit early for this - ie it would make a central piece of the code behave in a different way between 1.2 and 1.6 - when we have both versions in unit tests for all relevant repos, we can also start differentiating between the two versions.

@zah
Copy link
Contributor Author

zah commented Oct 19, 2021

We can have this disabled by default when it's time to switch to Nim 1.6.
For now, having it enabled facilitates testing Nim 1.6.

@arnetheduck
Copy link
Member

We can have this disabled by default when it's time to switch to Nim 1.6.

the other way around, let's add the flag now, and when we're comfortable, we make it default - the active choice should be to enable it

* Worked-around a bug where Nim comlains that the return value is
  not a path expression in functions lacking explicit return
  statements

* Worked-around a limitation that Nim doesn't allow:
  let foo: lent T = makeT()
## Fetch value of result if set, or raise Defect
## Exception bridge mode: raise given Exception instead
## See also: Option.get
assertOk(self)
self.v
return self.v
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like something to fix in the compiler rather than here, or we're in for a massive refactoring

@arnetheduck
Copy link
Member

We can have this disabled by default when it's time to switch to Nim 1.6.

in particular, because this change doesn't just impact our code - it impacts all projects using stew - we should not be handing them an unwelcome compiler bug present

@tersec
Copy link
Contributor

tersec commented Jan 20, 2024

Is this still relevant in this repo since results has moved to its own repo?

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.

3 participants