Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 02_advanced_stack_usage.ipynb #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gdsoumya
Copy link

@gdsoumya gdsoumya commented Jan 14, 2022

Fixed typo it should be CDR instead of CAR which removes the left part of the PAIR from stack

@claudebarde
Copy link
Collaborator

I am not sure that's a typo. It means that CDR extracts the right part of a pair as CAR extracts the left part.
If the wording seems confusing to you, would you like to offer a suggestion?

@gdsoumya
Copy link
Author

gdsoumya commented Jan 14, 2022

@claudebarde quoting from the documentation :

The first one is CAR that takes a pair at the top of the stack and returns the value on the left side. Note that the value on the right is taken out of the stack and lost:

and then

To extract the right part of the element on top of the stack, you can use CDR. As for CAR, the left part of the pair will be removed from the stack and lost:

While reading the tutorial if feels the first statement says CAR removes the right part permanently and the second says CAR removes the left part permanently. Making the second statement as CDR seems to make sense.

@m-kus m-kus self-assigned this Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants