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

setter/getter #89

Open
glassesneo opened this issue Apr 5, 2022 · 0 comments
Open

setter/getter #89

glassesneo opened this issue Apr 5, 2022 · 0 comments
Assignees
Labels
Status: Available Waiting for working on it Type: Improve Improve features which are working

Comments

@glassesneo
Copy link
Owner

glassesneo commented Apr 5, 2022

class pub A:
  var a*: int
  proc a*(value: int) {.setter.} =
    self.a = value

convert to below

type A* = ref object
  a: int
proc a*(self: A): int = self.a
proc `a=`*(self: A, value: int) =
  self.a = value
@glassesneo glassesneo created this issue from a note in Todo on features (To do) Apr 5, 2022
@glassesneo glassesneo self-assigned this Apr 5, 2022
@glassesneo glassesneo added Type: Improve Improve features which are working Status: Available Waiting for working on it labels Apr 5, 2022
@glassesneo glassesneo added this to the Release 0.5.0 milestone Apr 5, 2022
@glassesneo glassesneo removed this from To do in Todo on features Jun 28, 2022
@glassesneo glassesneo modified the milestones: Release 0.6.0, Release 1.0.0 Oct 7, 2022
@glassesneo glassesneo removed this from the Release 1.0.0 milestone Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available Waiting for working on it Type: Improve Improve features which are working
Projects
None yet
Development

No branches or pull requests

1 participant