]> gitweb.factorcode.org Git - factor.git/commitdiff
readline-listener: experiment with has-readline?
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 11 Feb 2022 19:53:35 +0000 (11:53 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 11 Feb 2022 19:54:13 +0000 (11:54 -0800)
if we can detect readline is available then we could use this as
a default listener in the future

extra/readline-listener/readline-listener.factor

index f4d6bb59c6db0b20dd69210b54caeadd98d59d24..8edd524d82374d91b00a3a07dd362cef574ec4a1 100644 (file)
@@ -63,4 +63,7 @@ PRIVATE>
     ] set-completion
     readline-reader new [ listener-main ] with-input-stream* ;
 
+: ?readline-listener ( -- )
+    has-readline? [ readline-listener ] [ listener ] if ;
+
 MAIN: readline-listener