For every 100% compliant R7RS-small program that does not rely on any implementation-specific or undefined behavior, is it true that every instance of letrec in the program can be replaced with letrec* without causing any change in behavior? In other words, is there any R7RS-small program where an appearance of letrec cannot be substituted with letrec*?
Can every letrec be replaced with letrec*?
123 Views Asked by Flux At
1
There are 1 best solutions below
Related Questions in SCHEME
- Lambda function not returning any value
- Encode "ä", "ö", "ü" and "ß" in scheme (file-output-port)
- How to programmatically expand the let* family of functions in racket
- Is there a way to implement named let as macro to make it work with Petrofsky let
- Scheme Question - How can I check if there are a list of pairs
- call/cc with Break procedure
- How to return in Scheme?
- SiCP Exercise 1.45
- Exercise 12.10 from the book Scheme and the art of programming
- How to write a Scheme function that uses call/cc to calculate factorial?
- Why can't a Scheme macro with the name "if" be defined?
- How to implement "if" in normal order in Scheme?
- Collision with syntax-rules identfiers and global names
- How to use let-values in Gambit Scheme?
- Racket: Issue with Sorting Strings in Ascending Order
Related Questions in LANGUAGE-LAWYER
- Can std::bit_cast be applied to an empty object?
- Static data member of template class type: constexpr vs. const constinit
- What was the problem with std::is_callable?
- Clang fails with "function with deduced return type cannot be used before it is defined", while GCC works
- Can a tentative definition use the storage class specifier _Thread_local?
- operator delete after both operator new and placement new?
- Is casting "pointer to array of type" to "pointer to type" defined?
- Are there uses of std::forward, where the argument is not a variable name?
- Why does C++ allow making a reference to a variable that goes out of scope?
- Deadlock on static-initialized jthread calling std::stacktrace_entry::description
- Is it legal to zero empty C++ classes in the constructor and inherit from them?
- Are there any specific types or values for which type-punning produces identical behavior in all Standard-conforming C implementations?
- Function pointer compatibility between single pointer and empty parameter lists
- In C++ can you use one empty type as storage for another?
- When is it safe to use [[no_unique_address]] in C++?
Related Questions in LETREC
- Why TSPL's letrec example can be run in ChezScheme with only let?
- Is letrec only meant for defining procedures?
- Why is the variable undefined in the initialization form of this letrec?
- Why does let not allow mutually recursive definitions, whereas letrec can?
- Can every letrec be replaced with letrec*?
- Can letrec be the same as letrec*?
- How to use `letrec` to define function "length" within the body of function "lengh-it"
- Generalised letrec semantics for mutual recursion
- Expression for defining letrec implementing little language in Haskell
- Understanding recurive let expression in lambda calculus with Haskell, OCaml and nix language
- Scheme: are `letrec` and `letcc` crucial for efficiency?
- How to implement letrec in Javascript?
- How is it possible that a binding shadows the existing binding in `case of` block?
- Haskell `let` bindings in lambda calculus
- Sharing vs. non-sharing fixed-point combinator
Related Questions in R7RS
- Which identifier am I supposed to use to close my library in R7RS/Scheme?
- How to export the same code as both an R6RS and R7RS library
- Why can't I write a byte to the current-output-port in the REPL?
- Can R7RS-small implementations allow only one define-library per file?
- Why might the Scheme `filter` form not process list elements 'in order'?
- Can every letrec be replaced with letrec*?
- Is define implementation dependent in R7RS?
- R7RS-small: equivalence of quasiquoted expressions
- How to consume only the first returned value in Scheme?
- How to define two R7RS libraries in Guile
- How to define a procedure that returns multiple values in R7RS
- How to (eval ...) in a chicken r7rs library?
- What are valid identifiers in R7RS-small?
- Is the cdr of a list always eqv?
- Hygienic macro r7rs : Return second expression value
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think that the answer is yes, it can, assuming that the form is not 'an error' in R7RS terminology (but see note at end). In particular I think that if there's a form like
Then it must be possible to evaluate
<e2>without referring to the value ofv1, but that binding does actually exist when<e2>is evaluated: it is just an error to refer to it. So in particular this is not allowed:because the binding that the init for
brefers to is that established by theletrec, not that established by thelet, but it is not yet legal to refer to the value of that binding.That being the case then if you simply replace
letrecbyletrec*then<e2>still will not refer to the value ofv1and thus the results will be the same.The converse is not true:
is fine, but you can't replace the
letrec*byletrecthere.That being the case I'm unclear what useful purpose
letrecserves (perhaps this is why Racket'sletrechas the semantics of Scheme'sletrec*).Note an earlier version of this answer came to the opposite conclusion. I am now not convinced I understand things well enough.