# Strange answer by YAML

**URL:** <https://www.ruby-forum.com/t/strange-answer-by-yaml/109217>\
**Category:** Ruby\
**Created:** [July 12, 2007, 1:58pm UTC](https://www.ruby-forum.com/t/strange-answer-by-yaml/109217 "2007-07-12T13:58:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [July 12, 2007, 1:58pm UTC](https://www.ruby-forum.com/t/strange-answer-by-yaml/109217/1 "2007-07-12T13:58:50Z")

</div>

x,xx = \*nil  
p x.class =\> NilClass  
p xx.class =\> NilClass

x, xx= \*YAML.load("")  
p x.class =\> FalseClass  
p xx.class =\> NilClass

Feature or bug ?

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [July 12, 2007, 3:55pm UTC](https://www.ruby-forum.com/t/strange-answer-by-yaml/109217/2 "2007-07-12T15:55:19Z")

</div>

On 7/12/07, Michel D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> x,xx = \*nil  
> p x.class =\> NilClass  
> p xx.class =\> NilClass
> 
> x, xx= \*YAML.load(“”)  
> p x.class =\> FalseClass  
> p xx.class =\> NilClass
> 
> Feature or bug ?

irb -r yaml  
irb(main):001:0\> YAML.load(“”)  
=\> false

So the return value from load is in a and as there are no more values,  
the rest of the variables (in this case xx) gets nil  
Without \* the results are the same:

irb -r yaml  
irb(main):001:0\> x,xx = nil  
=\> [nil]  
irb(main):002:0\> p x.class  
NilClass  
=\> nil  
irb(main):003:0\> p xx.class  
NilClass  
=\> nil  
irb(main):004:0\> x, xx= YAML.load(“”)  
=\> [false]  
irb(main):005:0\> p x.class  
FalseClass  
=\> nil  
irb(main):006:0\> p xx.class  
NilClass  
=\> nil

---

<div class="post-metadata">

**Author:** ![micheldogger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Post date:** [July 12, 2007, 8:05pm UTC](https://www.ruby-forum.com/t/strange-answer-by-yaml/109217/3 "2007-07-12T20:05:36Z")

</div>

Luis P. wrote:

> So the return value from load is in a and as there are no more values,  
> the rest of the variables (in this case xx) gets nil  
> Without \* the results are the same:

Thanks, MD
