Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/cmd/4th/lib/ascii7.4th

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


\ 4tH library - S>ASCII7 - Copyright 2004 J.L. Bezemer
\ You can redistribute this file and/or modify it under
\ the terms of the GNU General Public License

[UNDEFINED] IS-PRINT [IF]
[NEEDS lib/istype.4th]
[THEN]

[UNDEFINED] S>ASCII7 [IF]
: >white dup c@ is-white if bl over c! then ;
: >ascii7 dup c@ is-print 0= if [char] ^ over c! then ;
                                       \ strip all foreign chars                     
: s>ascii7                             ( a n -- a n) 
  over over                            ( a n a n)
  over >r                              ( a n a n)
  chars + r>                           ( a n a+n a)
  ?do i >white >ascii7 drop loop       ( a n)
;
[THEN]

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.