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

EVAL builtin function #350

Open
juliancoffee opened this issue Aug 7, 2022 · 0 comments
Open

EVAL builtin function #350

juliancoffee opened this issue Aug 7, 2022 · 0 comments

Comments

@juliancoffee
Copy link

juliancoffee commented Aug 7, 2022

As far as I know in Fluent we can't parametrise arguments. In a sense that this code will be impossible to parse.

skeleton = {$case ->
  [genitive] Skeleton
  [possessive] by Skeleton
}
cultist = {$case ->
  [genitive] Cultist
  [possessive] by Cultist
}
shoot = { $victim } has be shoot { $attacker(case: "possessive") }

This is obviously not a problem for English, but it is a problem for other languages with grammatical cases, for example, Slavic ones. https://en.wikipedia.org/wiki/Grammatical_case
(I translated the bear was killed by another bear to Polish and got niedźwiedź został również zabity przez innego niedźwiedzia. You can see the difference between niedźwiedź and niedźwiedzia)

So to solve it, I was thinking about adding EVAL function, which would take its first parameter as a term and pass args to it.

shoot = { $victim } has been shoot { EVAL($attacker, case: "possessive") }

P. S. after creating this, I saw #80 which would probably cover a lot of cases, but I thought about tossing this idea here in case someone would find it valuable.

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

No branches or pull requests

1 participant