janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.45k stars 223 forks source link

def special form bug #137

Closed ghost closed 5 years ago

ghost commented 5 years ago

I read and make examples from the documentation. https://janet-lang.org/docs/specials.html

This piece of code does not work properly in relation to the description:

(def [a b c] (range 10))
(print a " " b " " c) # prints 0 1 2

Example

Janet 1.0.0-local  Copyright (C) 2017-2019 Calvin Rose
janet:0:> (def [a b c] (range 10))
@[0
  1
  2
  3
  4
  5
  6
  7
  8
  9]
janet:25:> (print a " " b " " c) # prints 0 1 2
2 2 2
nil
janet:62:>
bakpakin commented 5 years ago

Ah, this is very much my bad. I added this regression recently and I remember doing it, I'm just surprised there were no test cases for it. I should have it fixed soon, and will probably release 1.0.1 with the fix.