marcomaggi / vicare

A native compiler for Scheme compliant with R6RS
http://marcomaggi.github.com/vicare.html
Other
200 stars 34 forks source link

bitwise-arithmetic-shift-right doesn't handle bignum shift amounts #50

Open weinholt opened 11 years ago

weinholt commented 11 years ago

The bitwise-arithmetic-shift-right procedure doesn't handle bignum shift amounts. The example below should return -1.

Vicare Scheme version 0.3d1, 64-bit Revision devel/eb362bf709a6d7d0da3bcfdf4c126ea6898137c1 Build 2013-08-20

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors Copyright (c) 2011-2013 Marco Maggi

vicare> (bitwise-arithmetic-shift-right -1 (+ (greatest-fixnum) 1)) Unhandled exception Condition components:

  1. &assertion
  2. &who: bitwise-arithmetic-shift-right
  3. &message: "expected fixnum as argument"
  4. &irritants: (1152921504606846976)
marcomaggi commented 11 years ago

This is a documented restriction. Sorry but it is very low priority for me to fix this. For the time being I have changed the type of raised condition object from &assertion to &implementation-restriction.

leppie commented 11 years ago

Thanks @weinholt. This is an issue in IronScheme too!