Skip to content

Expression -> Atom as the signal to not evaluate#144

Open
meditans wants to merge 2 commits intotrueagi-io:mainfrom
meditans:med/atom-triggers-quoting-behavior
Open

Expression -> Atom as the signal to not evaluate#144
meditans wants to merge 2 commits intotrueagi-io:mainfrom
meditans:med/atom-triggers-quoting-behavior

Conversation

@meditans
Copy link

This draft is meant as a starting point for a question on the topic we talked about yesterday: this function, which should be meant as identity over syntax

(: foo (-> Expression Expression))
(= (foo $a) $a)
!(foo a)

fails because a symbol is passed.

I wanted to see what broke if I tried to change it the way MeTTa does it, and there's not much to fix: a modification to translate_args_by_type function suffices, the other changes are mechanical fixes the test suite.

So now for the question: what else would be impacted by this? Am I missing something? You mentioned another solution:

Maybe expression just shouldn't generate a typecheck for testing for expression, just leaving it unevaluated

What would be the upshot in this case?

They were failing, and I think that's due to not importing foldall
correctly, but my quick try with:
```
!(import! &self ../lib/lib_import.metta)
!(use-module! aggregate)
!(import_prolog_function foldall)
```

Didn't solve the problem. Since it's unrelated to the change I want to
make, I'll leave them disabled for now.
In the MeTTa spec, Atom is the metatype that signals an argument should
be passed unevaluated/raw for metaprogramming purposes. In the previous
implementation this role was assigned to Expression.

The actual change happens just in the `translate_args_by_type` function.
The other changes are mechanical fixes to tests.
@meditans meditans changed the title Expression -> Atom as a type-guided signal for Expression -> Atom as the signal to not evaluate Mar 12, 2026
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.

1 participant