Re: [Chicken-hackers] [PATCH] Small improvement for the inline egg
From: Moritz Heidkamp Subject: Re: [Chicken-hackers] [PATCH] Small improvement for the inline egg Date: Thu, 07 Feb 2013 20:49:38 +0100 > Hello again, > > Moritz Heidkamp writes: >> 1. It dumps compilation results in ~/.cache by default. This, however, >>is a bit like dumping stuff in /usr/share so I think it would be >>better to make this ~/.cache/chicken-inline or something. > > Mario just pointed out to me in #chicken that the current default is > actually ".cache", not "~/.cache". It just happened to be that I ran csi > from my home when trying it out and then I didn't properly read the code > when hacking up the patch. Considering that this default directory is > apparently meant as a relative path I propose the attached new version > which sets it to ".chicken-inline" by default. I changed this to "~/.chicken-inline" and to allow overriding by setting $CHICKEN_INLINE_CACHE. Thanks, Moritz. cheers, felix ___ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers
Re: [Chicken-hackers] [PATCH] Small improvement for the inline egg
Hello again, Moritz Heidkamp writes: > 1. It dumps compilation results in ~/.cache by default. This, however, >is a bit like dumping stuff in /usr/share so I think it would be >better to make this ~/.cache/chicken-inline or something. Mario just pointed out to me in #chicken that the current default is actually ".cache", not "~/.cache". It just happened to be that I ran csi from my home when trying it out and then I didn't properly read the code when hacking up the patch. Considering that this default directory is apparently meant as a relative path I propose the attached new version which sets it to ".chicken-inline" by default. Moritz Index: inline.scm === --- inline.scm (revision 28291) +++ inline.scm (working copy) @@ -39,7 +39,7 @@ (define (inline-eval x . o) (inline-compile x (if (pair? o) (car o) "") #t)) -(define-constant default-inline-cache-name ".cache") +(define-constant default-inline-cache-name ".chicken-inline") (define windows-shell (foreign-value "C_WINDOWS_SHELL" bool)) (define inline-cache (make-parameter default-inline-cache-name)) @@ -94,7 +94,6 @@ (zero? (system (sprintf "cmp -s ~A ~A" (qs a) (qs b ))) (define (ensure-cache) - (unless (file-exists? (inline-cache)) -(create-directory (inline-cache)) ) ) + (create-directory (inline-cache) #t) ) ) ___ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers
[Chicken-hackers] [PATCH] Small improvement for the inline egg
Fellow Chickeneers, thanks to Felix mentioning it yesterday, I checked out the inline egg today. I think it's really neat, I recommend you to check it out, too, if you didn't, yet. I only noticed two things: 1. It dumps compilation results in ~/.cache by default. This, however, is a bit like dumping stuff in /usr/share so I think it would be better to make this ~/.cache/chicken-inline or something. 2. It does a redundant check for existence of the cache directory (remember the create-directory discussion a few days back) and doesn't create missing parent directories. This patch changes / fixes these things. Felix, feel free to apply or ignore it if you think it's silly :-) Thanks Moritz Index: inline.scm === --- inline.scm (revision 28291) +++ inline.scm (working copy) @@ -39,7 +39,7 @@ (define (inline-eval x . o) (inline-compile x (if (pair? o) (car o) "") #t)) -(define-constant default-inline-cache-name ".cache") +(define-constant default-inline-cache-name ".cache/chicken-inline") (define windows-shell (foreign-value "C_WINDOWS_SHELL" bool)) (define inline-cache (make-parameter default-inline-cache-name)) @@ -94,7 +94,6 @@ (zero? (system (sprintf "cmp -s ~A ~A" (qs a) (qs b ))) (define (ensure-cache) - (unless (file-exists? (inline-cache)) -(create-directory (inline-cache)) ) ) + (create-directory (inline-cache) #t) ) ) ___ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers