[racket] the extra empty string
Hi all,
Thank you very much for your replies. After having a fresh break, I
understand my mistake. Thanks a lot, Yoo: your explanation is very
clear.
--------------
Daniel
☵☯☲
2013/4/19 Pierpaolo Bernardi <olopierpa at gmail.com>:
> Or, maybe, what he's after is
>
> (for-each display '("" "0" "" "0")) ?
>
> (just guessing)
>
> Cheers
> P.
>
>
> On Sat, Apr 20, 2013 at 2:56 AM, Danny Yoo <dyoo at hashcollision.org> wrote:
>>
>> 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?
>> >
>> >
>> >
>> > --
>> >
>> > ☵☯☲
>> >
>> >
>>
>> ____________________
>> Racket Users list:
>> http://lists.racket-lang.org/users
>
>