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

Arithmetic operators with zero and one arguments #127

Open
camoy opened this issue Apr 26, 2021 · 0 comments
Open

Arithmetic operators with zero and one arguments #127

camoy opened this issue Apr 26, 2021 · 0 comments

Comments

@camoy
Copy link
Contributor

camoy commented Apr 26, 2021

Some arithmetic operators (like + and *) cause an error when given 0 arguments.

(+)

Gives:

match: no matching clause for '()
  location...:
   /home/camoy/wrk/soft-contract/soft-contract/parse/private.rkt:522:7
  context...:
   .../private/runtime.rkt:82:34: fail-handler2403
   /home/camoy/wrk/racket/racket/collects/racket/contract/private/arrow-higher-order.rkt:375:33
   [repeats 1 more time]
   .../private/parse.rkt:626:19: success
   /home/camoy/wrk/soft-contract/soft-contract/parse/private.rkt:105:7: stx-map
   /home/camoy/wrk/soft-contract/soft-contract/parse/private.rkt:110:7: stxs->modules
   /home/camoy/wrk/soft-contract/soft-contract/parse/main.rkt:26:4: parse-files65
   /home/camoy/wrk/soft-contract/soft-contract/verifier.rkt:49:2: havoc105
   /home/camoy/wrk/soft-contract/soft-contract/cmdline.rkt:59:4
   body of "/home/camoy/wrk/soft-contract/soft-contract/cmdline.rkt"
   /home/camoy/wrk/racket/racket/collects/raco/raco.rkt:41:0
   body of "/home/camoy/wrk/racket/racket/collects/raco/raco.rkt"
   body of "/home/camoy/wrk/racket/racket/collects/raco/main.rkt"

Using arithmetic operators with arity 1 can give an unsound result.

(+ "hi")

Gives:

Safe
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

No branches or pull requests

1 participant