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

astgen conditions #27

Open
GoogleCodeExporter opened this issue Apr 20, 2015 · 0 comments
Open

astgen conditions #27

GoogleCodeExporter opened this issue Apr 20, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

With immutable data structures it is sometimes convenient to be able to
"change" one field:
  Command newCommand = oldCommand.changeLabels(emptyList);
To be able to generate code for changeLables one would need to write a
template like
  \members{
    public \ClassName change\MemberName(\MemberType newMember) {
      return new \ClassName(\members[,]
        {\if{\MemberName==\MemberName[1]}{newMember}{\memberName}});
    }
  }
or something similar.

There are two things that must be done to get the template above to work:
1. support references to outer loops, as in \MemberName[0], \MemberName[1]
2. evaluate conditions

Original issue reported on code.google.com by radugrig...@gmail.com on 19 Aug 2009 at 5:54

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

No branches or pull requests

1 participant