Welcome to the CHICKEN Scheme pasting service

data-structure.scm excertp added by siiky on Thu Mar 7 19:36:06 2024

(define (##sys#substring=? s1 s2 start1 start2 n)
  (##sys#check-string s1 'substring=?)
  (##sys#check-string s2 'substring=?)
  (let ((len (or n  ; n may be greater than the strings' length
		 (fxmin (fx- (##sys#size s1) start1) ; start1 may be greater than s1's length
			(fx- (##sys#size s2) start2) ) ) ) ) ; same ^ for start2 and s2
    (##sys#check-fixnum start1 'substring=?) ; shouldn't these checks come before the let?
    (##sys#check-fixnum start2 'substring=?)
    (##core#inline "C_substring_compare" s1 s2 start1 start2 len) ) ) ; at this point len may be larger than 

(define (substring=? s1 s2 #!optional (start1 0) (start2 0) len)
  (##sys#substring=? s1 s2 start1 start2 len) )

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which one-argument R5RS procedure returns 3 when given `'(1 2 3 4)' as input?
Visually impaired? Let me spell it for you (wav file) download WAV