Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.forth    |    Forth programmers eat a lot of Bratwurst    |    117,927 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 116,864 of 117,927    |
|    dxf to sjack    |
|    Re: Parsing timestamps?    |
|    09 Oct 24 12:06:28    |
   
   From: dxforth@gmail.com   
      
   On 9/10/2024 7:30 am, sjack wrote:   
   > dxf wrote:   
   >   
   >> Not bad. Here's a translation. Hopefully it's equivalent (?)   
   >   
   > FigForth NUMBER is a quirky beast. It starts on a counted string   
   > but doesn't care about the count and it must end on a space.   
   > It's why I replaced ":" with space before I split and then   
   > split on space. Perhaps your NUMBER is better behaved.   
      
   I have many versions as no single one can cover all possibilities.   
   In the kernel alone there is:   
      
   : (NUMBER) ( addr u -- ud addr2 u2 )   
    0 0 2swap >number ;   
      
   : /NUMBER ( addr u -- addr2 u2 d|ud )   
    /sign >r (number) 2swap r> if dnegate then ;   
      
   : NUMBER? ( addr u -- d|ud true | false )   
    dup if /number dpl on 2swap dup if 1- over c@   
    [char] . - or dpl off then nip 0= if true end   
    then 2drop false ;   
      
   --- 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