basilisp-lang / basilisp

A Clojure-compatible(-ish) Lisp dialect targeting Python 3.8+
https://basilisp.readthedocs.io
Eclipse Public License 1.0
256 stars 6 forks source link

*flush-on-newline* support #866

Closed ikappaki closed 7 months ago

ikappaki commented 7 months ago

Hi,

could you please consider patch to support the Clojure's *flush-on-newlne* dynamic var. It fixes #865.

Although the corresponding documentation string in Clojure describes this variable as used for flushing the stream everytime a newline is printed, it is only referenced by prn to flush its output after the last newline has been written. This patch follows the same logic.

Thanks

ikappaki commented 7 months ago

In Clojure, println is based on prn, so I've also modified println to observer the dynamic variable.