KikyTokamuro / guile-pstk

PS/TK version (https://wiki.tcl-lang.org/page/PS%2FTk) fixed to work fine on modern GNU Guile
Other
6 stars 0 forks source link

Why not simplify `->string` into displaying into a string write port? #1

Open kakafarm opened 4 months ago

kakafarm commented 4 months ago

https://github.com/KikyTokamuro/guile-pstk/blob/70396a6c49be6829b8fb6c3815bcb06dd17b2874/pstk.scm#L238

Why not simplify ->string into displaying into a string write port?

It could be:

(define (->string x)
  (let ((out (open-output-string)))
    (display x out)
    (get-output-string out)))
KikyTokamuro commented 4 months ago

Hello @kakafarm! Yes, you are right, in principle it can be replaced with a simpler implementation of this function. You could submit a pull request and I will accept it.

kakafarm commented 4 months ago

Hello @kakafarm! Yes, you are right, in principle it can be replaced with a simpler implementation of this function. You could submit a pull request and I will accept it.

I am trying my luck at modernising this code in https://codeberg.org/kakafarm/guile-pstk/