Comments (4)
The pointer assignment/use is crossing a "par/or" rejoin, what is currently not allowed.
We may accept this program in the future, given that the assignment/rejoin/use occurs in the same reaction.
How difficult is to rewrite your code to get rid of the error?
I guess you wrote a simpler version and compiling it is not as simple as moving the "if c then..." to inside the "par/or".
from ceu.
The general pattern is: An organism is trying to acquire a pointer to something (by awaiting). The organism also wants to engage in an "idling" activity, which takes up as much time as necessary, but should be terminated when the organism can progress in its actual task.
Maybe this snippet conveys the (more complicated real task) more convincingly.
var Foo* ptr = null;
par/or do
_idle();
await FOREVER;
with
ptr = await generator;
end
_assert(ptr);
watching ptr do
_something();
end
I'll keep looking for a rewrite that doesn't involve crossing a par/or rejoin; it's probably a failure of imagination on my part.
from ceu.
Fair enough.
As a workaround, you can declare Foo as a "plain" pointer:
var Foo[] ptr = null;
(I also have a "TODO" with a similar pattern and workaround.)
from ceu.
Sorry, this is older than 1 year!
Using escape
, you can assign safely to the pointer that syntactically crosses a par
:
var u8&& ptr =
par do
//_idle();
await FOREVER;
with
await 1s;
escape null;
end;
escape ptr == null; // yields 1
from ceu.
Related Issues (20)
- Add support for `while` loop
- Bug in Compiler
- Accept `until` for `code/await`
- http://fsantanna.github.io/* should be http://ceu-lang.github.io/* HOT 1
- Bad message for error regarding prototype declaration and code/call HOT 1
- Error with code/dynamic using multiple trails
- "Invalid binding : incompatible scopes" error not being detected inside watching statement
- Unexpected error with dynamic spawn before subtype declaration
- Instructions in INSTALL.md seem outdated
- Example 15 from "Try Ceu" page isn't correct HOT 3
- invalid input pool[7] uint ids; crashes the compiler HOT 1
- loop x in [a->b] tags x as constant but remains set after loop exits HOT 1
- Correct #line numbers HOT 1
- Integrate run-time assertions with Céu Exceptions HOT 1
- Use "kill" command makes application terminates unexpectedly HOT 2
- await for a code/await abstraction inside every does not produce errors HOT 1
- Wrong error message on call method without 'call'. HOT 1
- C comments don't ignore interpolated Céu expressions
- Events declared as a public fields don't work when using code/await prototype
- gcc -O1 and async/thread
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ceu.