Skip to content

Conversation

@Rafael-Sapienza
Copy link
Owner

Modificações:

  • Suporte para funções recursivas
  • Funções agora podem ser passadas como argumentos de outras funções
  • Polimorfismo de funções
  • Suporte para expressões lambda

…uments

Functions are now stored in the environment using their full
signatures rather than just their names. This allows support for
polymorphic functions and multiple overloads with different type
parameters.

Additionally, when evaluating a FuncCall whose target is an
Expression::Var, the resolution process has changed. Instead of
directly evaluating the variable and assuming it holds a value, we now
perform a scoped lookup. In each environment scope, we first look for
a variable with the given name; if not found, we then look for a
function. This behavior ensures variables shadow functions of the same
name in the same scope.

This change allows function values to be passed as arguments and gives
priority to local variables when both a function and variable share
the same identifier, enabling more flexible and predictable behavior
in higher-order and polymorphic scenarios
@Rafael-Sapienza Rafael-Sapienza merged commit fa151a4 into main Jul 20, 2025
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