(possibly) unexpected behaviors compared to the spec (from a newbie) #88
Replies: 3 comments
-
Thanks for the kind words! I think you've found some bugs 😄 For the first point, yes, static strings are interned, so they will share the same memory address. Integers that are Per the second point, floating point equality in Rust can be tricky, and looks like I'm not correctly handling it. I'll include this as part of the above PR as well. Thanks for finding these! |
Beta Was this translation helpful? Give feedback.
-
This should be fixed in #89 - thanks again for catching this! |
Beta Was this translation helpful? Give feedback.
-
thank you for the quick response and updates! your explanation makes total sense, and fast fixes are awesome. |
Beta Was this translation helpful? Give feedback.
-
Hello!
I am a complete beginner interested in functional programming so my questions here may be completely ignorant, in which case you can just ignore them.
I'm currently following a tutorial Yet Another Scheme Tutorial and reading r7rs.pdf and testing by running steel interpreter locally (
cargo run
).While playing around with the interactive steel interpreter, I found some behaviors that are different than expected; I understand that many behaviors are up to the implementations, so wanted to know if there were docs or clarifications for expected behaviors of steel.
Below are the examples:
I assume this is an intended decision for optimization, but it would be very interesting if you could explain the story behind the decision.
Although this also could be up to implementations, I think a lot of interpreters I found say that
=
check equality of values, even for floating points. Is there a reason why this is different?Is it not possible to check equality of floating points using
=
?Even in r7rs.pdf, they have an example showing the following case:
meaning
when
returning value is unspecified, but the evaluation should print12
.Btw, this is an amazing project, being able to embed rust structs and call rust functions from scheme; thank you, and I will continue to study Scheme and implementation of Steel.
Beta Was this translation helpful? Give feedback.
All reactions