[racket] the extra empty string
On Fri, Apr 19, 2013 at 6:47 PM, Kejia柯嘉 <w.kejia at gmail.com> wrote:
> Hi Yoo,
>
> You may try (display '("" "0" "" "0")), and you will find two whitepaces
> between 0.
The function "display" delimits between elements of a list by
inserting a space between each pair. It simply turns out that
displaying the empty string doesn't do anything. The output you're
seeing should be consistent with that behavior.
Given:
'("" "0" "" "0")
It is displaying:
the left-paren,
the "",
the space delimiter,
the "0",
the space delimiter,
the "",
the space delimiter,
the "0",
the right-paren.
Why are you using display to look at the content of lists? Usually,
write or print is more appropriate:
http://docs.racket-lang.org/guide/read-write.html
>
> 在 2013年4月19日星期五,Danny Yoo 写道:
>
>> On Fri, Apr 19, 2013 at 5:44 PM, Kejia柯嘉 <w.kejia at gmail.com> wrote:
>> > Hi all,
>> >
>> > In DrRacket, why is there an extra empty string (`[]`between 0s) in
>> > the list:`'("" "0" "" "0")`. This generates `([]0[][]0)`, instead of
>> > `([]0[]0)`.
>>
>>
>> Unfortunately, the question here is ambiguous. What are you trying to
>> do? Can you show us the code you are using to distinguish the empty
>> string? What expression are you trying to evaluate such that you get
>> this list in the first place?
>
>
>
> --
>
> ☵☯☲
>
>