Comments (8)
Yep the above should work fine :)
from hacspec.
I prefer to allow inline if then else
expressions, it's not much work for me. However, I cannot allow let declarations without initialization because their semantics cannot be easily mapped to a regular functional language semantic.
from hacspec.
That works too. People might be more used to let bindings without, but not in Rust. So we should allow the following
let x = if y > 5 {
1
} else {
2
};
from hacspec.
@denismerigoux this doesn't appear to work.
error[Hacspec]: let binding expression should not contain statements in Hacspec
--> /Users/franziskus/repos/hacspec/examples/p256/src/p256.rs:71:18
|
71 | let result = if is_point_at_infinity(p) {
from hacspec.
What is the code after ? Because the error message seems correct ot me : "let binding expression should not contain statements in Hacspec"
from hacspec.
I'm trying to get the p256 code into hacspec
hacspec/examples/p256/src/p256.rs
Lines 71 to 75 in 9270342
from hacspec.
What is in the else
branch? Something forbidden in Hacspec would be
let result = if is_point_at_infinity(p) {
(true, q)
else { foo = x; (false, q)}
from hacspec.
Inline conditionals (inside let
statements) cannot have side-effects (like variable assignment) right now in Hacspec. Otherwise the compilation scheme to something like F* becomes much more complicated.
from hacspec.
Related Issues (20)
- Split ed25519 into two separate crates HOT 2
- Unable to use hacspec in edition 2021 crates
- Using consts from other module fails HOT 3
- Replace im
- Return Result type
- Allow skipping the enum type when using variants
- Implement unary negation for natural number
- ^ operation not available for type bool
- A sequence of sequences
- Importing from the same crate
- Empty Tuple struct, does not work
- Add F* to the CI
- Bad name resolution in the case of external re-exported module HOT 1
- Type the AST more precisely, to avoid `unwrap`s and `panic`s
- Add result let binding
- F* backend: variants are extracted to constructors whose payloads are tuples
- Outdated README
- Cleanup warnings
- implementation of from_be_bytes in math_integers is missing HOT 1
- syn 2 breaks the build HOT 6
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 hacspec.