summary refs log tree commit diff stats
path: root/lib/pure/encodings.nim
Commit message (Expand)AuthorAgeFilesLines
* Removed libiconv prefix (on OS X) to make encodings compile on OS X.Hans Raaf2015-10-281-10/+4
* lib: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-185/+185
* lib/pure/e-o - Dropped 'T' from typespdw2015-06-041-2/+3
* fix for https://github.com/nim-lang/Aporia/issues/69Stephan Diehl2015-05-281-1/+1
* Don't run non-test code when defined(testing)Oleh Prypin2015-04-211-1/+1
* Fix typosFederico Ceratto2015-02-151-1/+1
* Happy new year!Guillaume Gelin2015-01-061-1/+1
* more tests greenAraq2014-08-311-12/+12
* more modules updatedAraq2014-08-281-9/+9
* big renameAraq2014-08-271-16/+18
* added OEMCP for the default OEM codepageAraq2014-06-261-0/+1
* make encodings.nim case consistentAraq2014-01-191-33/+31
* more tests are greenAraq2013-12-081-5/+5
* Removes executable bit for text files.Grzegorz Adam Hankiewicz2013-03-161-0/+0
* Adds macosx dynamic library name for libiconv.Grzegorz Adam Hankiewicz2012-12-171-4/+11
* fixes #162Araq2012-07-101-1/+1
* some more bugfixes for the integer promotion rulesAraq2012-07-101-2/+2
* year 2012 for most copyright headersAraq2012-01-021-1/+1
* bugfix: shallowCopy should not break bootstrapping anymore; encodings.nim for...Araq2011-06-211-2/+13
* added encodings stdlibAraq2011-06-161-0/+445
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


                                                               

                                                               
               

                                                   


                                           
                                                                                                                      
                                                       
                           
         
                                                                              
                                                                  




                                             

                                                        


          
; reads and prints keys until you hit 'q'
; no need to hit 'enter', and 'enter' has no special meaning
; dies if you wait a while, because so far we never free memory
(function main [
  (default-space:space-address <- new space:literal 30:literal)
  (cursor-mode)
  ; hook up stdin
  (stdin:channel-address <- init-channel 1:literal)
;?   ($print (("main: stdin is " literal)))
;?   ($print stdin:channel-address)
;?   ($print (("\n" literal)))
  (fork-helper send-keys-to-stdin:fn nil:literal/globals nil:literal/limit nil:literal/keyboard stdin:channel-address)
  ; now read characters from stdin until a 'q' is typed
  ($print (("? " literal)))
  { begin
    (x:tagged-value stdin:channel-address/deref <- read stdin:channel-address)
    (c:character <- maybe-coerce x:tagged-value character:literal)
;?     ($print (("main: stdin is " literal)))
;?     ($print stdin:channel-address)
;?     ($print (("\n" literal)))
;?     ($print (("check: " literal)))
;?     ($print c:character)
    (done?:boolean <- equal c:character ((#\q literal)))
    (break-if done?:boolean)
    (loop)
  }
])