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

Support fixed string argument with instance_eval #2285

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

herwinw
Copy link
Member

@herwinw herwinw commented Nov 4, 2024

Marking as draft for now, the code works but I'm not that satisfied with how it looks.

Transform instance_eval with a fixed string into a block at compile time, similar to the eval macro handling.

@herwinw herwinw self-assigned this Nov 4, 2024
@herwinw herwinw force-pushed the instance_eval_fixed_strings branch 2 times, most recently from b04b86b to 599d978 Compare November 12, 2024 07:32
@herwinw herwinw force-pushed the instance_eval_fixed_strings branch 3 times, most recently from 93d64bb to 1ac6004 Compare November 14, 2024 08:04
Extract methods to handle compile time strings. We can reuse these for
instance_eval.
This is a compile time macro, similar to eval.
This is just the same macro code, called from a different location. This
needs an extra check to ensure we operate on a compile time macro.
@herwinw herwinw marked this pull request as ready for review November 15, 2024 06:05
@herwinw herwinw removed their assignment Nov 15, 2024
@herwinw
Copy link
Member Author

herwinw commented Nov 15, 2024

Moved the code to macros.rb and shared as much code with the eval macro as possible. This should be ready now

@seven1m seven1m merged commit d02eced into natalie-lang:master Nov 15, 2024
15 checks passed
@herwinw herwinw deleted the instance_eval_fixed_strings branch November 15, 2024 15:45
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