Re: Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread William Michels via perl6-users
On Mon, May 18, 2020 at 10:18 AM Brad Gilbert wrote: > > You are misunderstanding what `put` does. > > It does not print the internal representation. > > What it does do is turn the value into a `Str` object, then print it with a > trailing newline. > > It just so happens that objects will by

Re: Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread William Michels via perl6-users
On Mon, May 18, 2020 at 4:03 AM Patrick R. Michaud wrote: > > "say $x" is essentially equivalent to "put $x.gist". > > Since Nil is undefined (roughly equivalent to a type object), Nil.gist has a > string value of "Nil" and can be printed. However, attempting to convert Nil > directly into a

Re: Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread Brad Gilbert
You are misunderstanding what `put` does. It does not print the internal representation. What it does do is turn the value into a `Str` object, then print it with a trailing newline. It just so happens that objects will by default return something that looks like an internal representation when

Re: Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread Patrick R. Michaud
"say $x" is essentially equivalent to "put $x.gist". Since Nil is undefined (roughly equivalent to a type object), Nil.gist has a string value of "Nil" and can be printed. However, attempting to convert Nil directly into a Str throws an error because that's attempting to stringify an

Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread William Michels via perl6-users
Hello, I'm interested in knowing the differences between the return values when "say" is used compared to "put". My understanding is that "put" returns Raku's internal representation of a value held by a variable, while "say" is merely "put" with the .gist method called on it (a "human readable",