logoalt Hacker News

vidarhyesterday at 9:30 AM1 replyview on HN

The point was that logically it would be an array lookup by index.

There's no need for any conditional construct here whatsoever.

You'll note it has already constructed a string in the right order to do that, but then copped out with the if-else.


Replies

e12eyesterday at 1:09 PM

True enough. On that note, I had a look at the language reference - there's arrays - but also this:

    (char_at s index)        # Get ASCII value at index (0-based)
    (string_from_char code)  # Create string from ASCII value
So, you can pluck a character... From an UTF-8 string? What if the rendering used multibyte characters?
show 1 reply