contract violation when running #lang reader stacker-demo/stacker #25

Closed
opened 2 years ago by antonmosin · 2 comments
antonmosin commented 2 years ago (Migrated from github.com)

In the first tutorial, I encounter an error on MacOS when running this command:

#lang reader stacker-demo/stacker

 Library/Racket/8.3/pkgs/beautiful-racket-demo/stacker-demo/stacker.rkt:14:5: first: contract violation
  expected: (and/c list? (not/c empty?))
  given: '()

which seems to originate here

My installation seems to be correct, asracket -l br/test returned You installed beautiful-racket v1.6 correctly. and I can run #lang br, #lang br/quicklang without problems. I've also set the #lang br to be default as suggested in the tutorial.

In the first tutorial, I encounter an error on MacOS when running this command: `#lang reader stacker-demo/stacker` ``` Library/Racket/8.3/pkgs/beautiful-racket-demo/stacker-demo/stacker.rkt:14:5: first: contract violation expected: (and/c list? (not/c empty?)) given: '() ``` which seems to originate [here](https://github.com/mbutterick/beautiful-racket/blob/b0d133f4ba4149ea506d8b0dbd3845c915efdd06/beautiful-racket-demo/stacker-demo/stacker.rkt#L14) My installation seems to be correct, as`racket -l br/test` returned `You installed beautiful-racket v1.6 correctly.` and I can run `#lang br,` `#lang br/quicklang` without problems. I've also set the `#lang br` to be default as suggested in the tutorial.
mbutterick commented 2 years ago (Migrated from github.com)

I believe you’re getting that error because you’re running the program without any input. What happens when you run the actual sample program?

#lang reader stacker-demo/stacker
4
8
+
3
*
I believe you’re getting that error because you’re running the program without any input. What happens when you run the [actual sample program](https://beautifulracket.com/stacker/intro.html#a_V7pxH)? ``` #lang reader stacker-demo/stacker 4 8 + 3 * ```
antonmosin commented 2 years ago (Migrated from github.com)

Thank you very much for the prompt reply, @mbutterick: you're right, it works! Sorry for the false alarm, I didn't realise that it doesn't work with empty input.

Thank you very much for the prompt reply, @mbutterick: you're right, it works! Sorry for the false alarm, I didn't realise that it doesn't work with empty input.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/beautiful-racket#25
Loading…
There is no content yet.