Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.programming    |    Programming issues that transcend langua    |    57,431 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 56,960 of 57,431    |
|    Noel Duffy to Stefan Ram    |
|    Re: Scanning    |
|    21 Jan 23 11:29:13    |
      From: uaigh@icloud.com              On 21/01/23 01:16, Stefan Ram wrote:       > ram@zedat.fu-berlin.de (Stefan Ram) writes:       [..]       >       > The output often ends with one space, because a '\n' is       > added to the end of the input if it's missing, and this       > then is being converted to a space. So, ironically, while       > I set out to strip spaces at the end of lines, I now       > sometimes add them to the end of lines!              While I don't have any great insight to offer, I did write a small       markup engine a few years ago (in Object Pascal). What you say above       brought back memories of struggles I had with my code too. The       conclusion I came to at the time is that when it comes to things like       spacing, there are several equally valid ways to do it, and you'll       probably want different handling for different use-cases, so it's better       to parameterize it so that users of your code can set which handling       they prefer. I went with making it a parameter. It's a bit more work but       the flexibility is usually worth it in the long run.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca