Skip to content

Instantly share code, notes, and snippets.

@shanecelis
Last active December 17, 2015 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanecelis/5599411 to your computer and use it in GitHub Desktop.
Save shanecelis/5599411 to your computer and use it in GitHub Desktop.
;; Possible bug, or at least unexpected behavior, for typed array
;; literals. Demonstration below. The same storage is used
;; for the same literal.
;;
;; Run on guile (GNU Guile) 2.0.5 on Mac OS X.
;;
;; Shane Celis
(define x #f64(0. 1. 2.))
(define y #f64(0. 1. 2.))
;; Set the first element of x to 1.
(array-set! x 1 0)
(display x) ;; will display #f64(1.0 1.0 2.0)
(newline)
(display y) ;; will display #f64(1.0 1.0 2.0)
(newline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment