retroforth@xxxxxxxxxxxxx schrieb am 24.01.05 18:19:28: > > > On Mon, January 24, 2005 3:04, Charles Childers said: > > Thank you for pointing this out. I've incorporated the change to my > > codebase for retro8. > > Glad to be of service :-) > > Helmar: it's usual to use 'u.' to unsignedly print (decimal). Well, of course. I start with unsigned and extend the word to signed or whatever. I've currently hacked an extension to my HelFORTH to do so: ------------------------------ | Requires: bases sys~ : +rich-output make . base @ case 8 of dup if '0 emit then endof 10 of 0 over >if negate '- emit then endof 16 of '$ emit endof endcase [ ' . 5 + compile ] ;and ; ------------------------------ > In my latest Reva (not on the site) I have the <# # #S #> words working for > qword output, although the sign stuff is not working yet correctly I think. > > I am considering modifying the '(.)' primitive so it pays attention to a > 'width' parameter. So doing something like: > > 2 #. ! | set output width > 3 . > > would output 03 instead of 3. I dont really like that #-stuff. Especially because I do not see the need of doubles :) I currently prefer a solution like ------------------------------ : digits | n -- ... c 1 begin over base @ 1- >while >r base @ /mod swap r> 1+ repeat ; : >xdigit dup 10 u<if '0 else 55 then + ; : .n | n c -- dup >r for base @ /mod swap loop drop r> [ : .digits for >xdigit emit loop ; ------------------------------ Where "digits" splits a number into digits and the count of digits, ">xdigit" converts a digit to a character, ".n" outputs a n-length number and ".digits" outputs what "digits" generates. So "." would look like : . 0 over >if negate '- emit then digits .digits ; > However, now I have the # word working, it's trivial to do that with <# # # #> > ( as long as you have a DOUBLE on the stack. So maybe I won't modify '.' at > all... > > But for example, 'dump' should output "normal" hex, e.g. two-character codes > rather than the one character it does now. :) That's what I mean. Making . too smart is no good way... Bis dann, Helmar helmwo@xxxxxx > -- > My GPG public key is at http://ronware.org/ > fingerprint: 8130 734C 69A3 6542 0853 CB42 3ECF 9259 AD29 415D > > > > -- Binary/unsupported file stripped by Ecartis -- -- Type: application/x-pkcs7-signature -- File: smime.p7s -- Desc: S/MIME Cryptographic Signature