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

Document schedule() functions in Cpp #40

Open
edwardalee opened this issue Apr 25, 2022 · 2 comments
Open

Document schedule() functions in Cpp #40

edwardalee opened this issue Apr 25, 2022 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@edwardalee
Copy link
Contributor

In the packages/documentation/copy/en/reference/Target Language Reference.md file, there is a FIXME that says:

FIXME: Give a list of schedule() functions with descriptions.

Can someone add that list or point me to where to find it? The examples show schedule() and schedule_int(). Others?

@cmnrd
Copy link
Contributor

cmnrd commented Apr 26, 2022

There is no schedule_int in C++. If it is listed in a C++ example, the example should be fixed.

reactor-cpp provides 4 overloaded variants of schedule() defined here. All of them expect a value and a duration. The duration may be omitted and has a default of 0. The 4 overloads all accept different types for the value. These can be an immutable value pointer, a mutable value pointer, an rvalue reference or an lvalue reference. To make it even more complicated, schedule is a function template and can accept different duration types.

While we should explain how values work in C++, I don't think this is the place. I think it is best to just say that there is a single schedule function expecting a value (whatever that is) and an optional duration. We should probably link here to the target API documentations (except that these methods are not documented yet for C++...).

I hope this helps. I can also take a look at the text tomorrow.

@edwardalee
Copy link
Contributor Author

The doc has this example:

reactor CountSelf(delay:time(100 msec)) {
    output out:int;
    logical action a:int;
    reaction(startup) -> a, out {=
        out.set(0);
        a.schedule_int(1, delay);
    =}
    reaction(a) -> a, out {=
        out.set(a.get());
        a.schedule_int(*a.get() + 1, delay);
    =}
}

which looks wrong.

@axmmisaka axmmisaka added the documentation Improvements or additions to documentation label May 10, 2024
@cmnrd cmnrd added this to the website cleanup milestone Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: Todo
Development

No branches or pull requests

3 participants