On a second thought, here is what write-line does:

(define write-line
  (lambda (str . port)
    (let ((p (if (##core#inline "C_eqp" port '())
                 ##sys#standard-output
                 (##sys#slot port 0) ) ) )
      (##sys#check-port p 'write-line)
      (##sys#check-string str 'write-line)
      (display str p)
      (newline p) ) ) )

and here is display:

(define (display x #!optional (port ##sys#standard-output))
  (##sys#check-port* port 'display)
  (##sys#print x #f port) )

And check-string:

(define (##sys#check-string x . loc) 
  (if (pair? loc)
      (##core#inline "C_i_check_string_2" x (car loc))
      (##core#inline "C_i_check_string" x) ) )

Now if you would uncomment the check-string in write-line, is it
equally fast then?  I would expect it to be.

Then the question is, what makes check-string slower...

Thanks, this is getting interesting!

Christian

-- 
Who can (make) the muddy water (clear)? Let it be still, and it will
gradually become clear. Who can secure the condition of rest? Let
movement go on, and the condition of rest will gradually arise.
 -- Lao Tse. 

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to