[racket] the extra empty string
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130420/279781c7/attachment.html>