Comments (4)
I will try again and report back, thanks for checking!
from sesterl.
I must have been running the compiler wrong way somehow, or my editor was playing tricks with me, I am getting errors now!
BTW: WOW this is very cool
from sesterl.
I even tried changing
let n = 10 in
tolet n = "10"
in and didn't get any errors
I couldn't reproduce this problem. The following change is rejected as intended:
module Example = struct
/* dummy */
val some_heavy_calculation(n) =
n
val rec wait_all(msgacc, n) = act
if n <= 0 then
return(msgacc)
else
receive
| {pid, msg} ->
let _ = print_debug(format(f'message ~p received from: ~p~n', {msg, pid})) in
wait_all(msg :: msgacc, n - 1)
end
val rec spawn_all(pidacc, n) = act
if n <= 0 then
return(pidacc)
else
do parent <- self() in
do pid <-
spawn(fun() -> act
do me <- self() in
let msg = some_heavy_calculation(n) in
send(parent, {me, msg})
end)
in
spawn_all(pid :: pidacc, n - 1)
val main(arg) = act
- let n = 10 in
+ let n = "10" in
do pids <- spawn_all([], n) in
let _ = print_debug(format(f'spawned: ~p~n', {pids})) in
do msgs <- wait_all([], n) in
let _ = print_debug(msgs) in
return({})
end
$ sesterl build example.sest -o _generated/
parsing '<path/to>/example.sest' ...
type checking '<path/to>/example.sest' ...
! [Type error] file 'example.sest', line 33, characters 15-24:
this expression has type
fun(list<pid<'a>>, int) -> [{pid<'a>, int}]list<pid<'a>>
but is expected of type
fun(list<pid<'a>>, binary) -> [{pid<'a>, int}]list<pid<'a>>
from sesterl.
Iām glad to hear that. Thank you anyway for reporting!
from sesterl.
Related Issues (20)
- contributing: `make test` doesn't pass when alcotest is not installed HOT 1
- contributing: `make` doesn't work if you didn't run `opam` first
- Allow to import the main module in tests HOT 9
- Unbound type variable error for example from readme HOT 2
- Set configuration file name sesterl.yaml instead of package.yaml HOT 1
- An unsoundness bug found
- Mutually recursive modules HOT 2
- andalso, orelse HOT 2
- Version selector in documentation HOT 1
- Polymorphic variants HOT 1
- Operator precedence HOT 2
- Warn when non-recursive function is declared with `val rec` HOT 1
- Polymorphic equality and nonequality operators
- Support Erlang Guard expressions
- Add unary boolean negation operator
- Show code snippet on compilation error HOT 1
- Parse negative numbers
- Arithmetic operators associativity is wrong HOT 3
- Support `core.v0.15.1`
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 sesterl.