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

add Emit IO #257

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

add Emit IO #257

wants to merge 1 commit into from

Conversation

racs4
Copy link
Contributor

@racs4 racs4 commented Dec 1, 2022

This IO allows users emit (or log) events of its own interest

It follows the description provided in #183; closes #183

This IO allows users emit (or log) events of its own interest

It follows the description provided in #183
@racs4 racs4 requested a review from steinerkelvin December 1, 2022 21:21
// checks if args is a number
if self.check_num(term_to_emit, mana).is_err() {
// if not a number, checks if is a flat CTR
self.check_ctr_argm(subject, None, mana, term_to_emit)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should limit this the same way as CALL. I'll review this better tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the issue #183 is written:

Emitted terms would be limited somehow, so it's O(1) to read them. Could be in the same way contract call input is limited: only allowing flat Ctrs on U120s.

The way is done, is only allowing "flat" Ctrs or pure U120

if let Some(call_term) = call_term {
events.push(Event {
fnid: subject,
argm: call_term,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not sure how storing RawTerms is working here. I'm pretty sure it should be readback'ed to a Term as in the done_term field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I avoided using readback or doing any transforms on run_io itself. So I send the RawCell's back as a result, and in the run_statement function, after checking everything and doing the readback of the done_term is that I actually read what is written in these RawCell's (I used the show_term, but was going to ask you if I should use readback instead).

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