[un]get/put-char etc.

9 views
Skip to first unread message

Kurt Pagani

unread,
Jan 26, 2026, 2:56:33 PM (11 days ago) Jan 26
to CLIPSESG
Hi 
I have encountered a strange behavior when using the unget/get-char functions:

CLIPS (6.4.3 11/11/25)

(unget-char 67) ; ==> 67
(get-char)      ; ==> C

I don't think this is intentional? I assumed get-char always returns an integer.

Furthermore I'm missing put-char in the bpg.  

Last but not least a feature request (you may ignore it :)
* A (version) function, e.g. returning a float 6.43 or so ....
* A (ord  <char>) function (like printf with %f
* A (chr <int>) function, e.g. casting to char 

Thanks
Kurt  

Kurt Pagani

unread,
Jan 26, 2026, 4:36:33 PM (11 days ago) Jan 26
to CLIPSESG
Correction: I was mistaken :( 
I've seen that the 'C' occurs independently of using (get-char) because it's in stdin, of course. 
Secondly, it should read "printf with %d" not f%.

False alarm, sorry ;)

Kurt Pagani

unread,
Jan 26, 2026, 7:15:04 PM (11 days ago) Jan 26
to CLIPSESG
I recognized that 
 (format nil "%c" 62) ==>  ">"
Hence a 'char' function isn't necessary, indeed. Maybe there is also a reverse method (ord) which I have overlooked?
Reply all
Reply to author
Forward
0 new messages