This is the mail archive of the cgen@sourceware.org mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][commit] Location of (include file)


   From: Dave Brolley <brolley@redhat.com>
   Date: Tue, 09 May 2006 14:22:02 -0400

   + ; Return the directory name of the given file name
   + 
   + (define (dirname s)
   +   (let loop ((i (string-length s)))
   +     (cond ((= i 0) "")
   + 	  ((char=? #\/ (string-ref s (- i 1))) (substring s 0 i))
   + 	  (else (loop (- i 1)))))
   + )
   + 

guile> (version)
"1.4.1.107"
guile> (dirname "/etc/hosts")
"/etc"
guile> dirname
#<primitive-procedure dirname>

thi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]