Re: Trouble using (current-filename)

2012-02-19 Thread Ludovic Courtès
Hi, Andy Wingo skribis: > On Fri 17 Feb 2012 23:49, l...@gnu.org (Ludovic Courtès) writes: > >> Would it work to let the user call it themself if needed, like: >> >> (add-to-load-path (dirname (canonicalize-path (current-filename > > I would rather have current-filename do a > > (or (fal

manual examples - self contained or not?

2012-02-19 Thread Ian Price
Hi guilers, is there an "official" policy on whether or not examples in the manual should be self contained? On IRC, kudkudyak was confused about read-line not being found when he tried to run one of the socket examples. Naturally, I pointed out that this is because read-line is in (ice-9 rdelim

Re: manual examples - self contained or not?

2012-02-19 Thread Nala Ginrut
well, I don't believe in copy-paste code too. But my vote would be "at least I can trust the official manual"... On Mon, Feb 20, 2012 at 12:42 AM, Ian Price wrote: > > Hi guilers, > > is there an "official" policy on whether or not examples in the manual > should be self contained? > > On IRC, ku

Re: Adding Identities to Peval

2012-02-19 Thread Andy Wingo
On Sat 18 Feb 2012 17:20, Noah Lavine writes: > Here is another patch that fixes the first of my examples. (let* ((x > (random)) (y x)) (eq? x y)) now folds to (begin (random) #t). It > turned out to be much smaller than the previous approach. Is it all > right if I push this? Looks good to me,

Re: allocation within critical sections

2012-02-19 Thread Andy Wingo
On Fri 17 Feb 2012 23:59, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo skribis: > >> Ooooh, good one. A bug in Guile, this one, and tricky to get around. >> Of course, running finalizers in a separate thread will solve it. > > It’s about [deferring] user-provided finalizer execution, no?

Re: Trouble using (current-filename)

2012-02-19 Thread Andy Wingo
Hi, On Sun 19 Feb 2012 15:10, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo skribis: > >> On Fri 17 Feb 2012 23:49, l...@gnu.org (Ludovic Courtès) writes: >> >>> Would it work to let the user call it themself if needed, like: >>> >>> (add-to-load-path (dirname (canonicalize-path (current

Re: allocation within critical sections

2012-02-19 Thread Ludovic Courtès
Hi, Andy Wingo skribis: > On Fri 17 Feb 2012 23:59, l...@gnu.org (Ludovic Courtès) writes: [...] >> What about using asyncs for that? For instance, scm_i_finalize_smob >> make a [deferred], instead of direct, call to the SMOB’s ‘free’, via >> scm_i_queue_async_cell. > > It's an interesting id

Re: manual examples - self contained or not?

2012-02-19 Thread Noah Lavine
Hello, > My vote would be for self-contained: it can be copied directly into a > file or REPL and executed, and IMO reduces confusion. I already try to > do this when posting any examples on paste.lisp.org or in a gist. When you say "self-contained", do you mean that if the example uses a procedu

Re: Trouble using (current-filename)

2012-02-19 Thread Ludovic Courtès
Hello! Andy Wingo skribis: > On Sun 19 Feb 2012 15:10, l...@gnu.org (Ludovic Courtès) writes: > >> Andy Wingo skribis: >> >>> On Fri 17 Feb 2012 23:49, l...@gnu.org (Ludovic Courtès) writes: >>> Would it work to let the user call it themself if needed, like: (add-to-load-path (

Re: build-lexical-var vs. -Wunused-variable

2012-02-19 Thread Andy Wingo
On Fri 17 Feb 2012 12:00, l...@gnu.org (Ludovic Courtès) writes: > Commit f9685f437312ea790981373ddc375b2a26ba9c4f changes > ‘build-lexical-var’ like this: > > (define-syntax-rule (build-lexical-var src id) > - (gensym (string-append (symbol->string id) " "))) > + (gensym (string-ap

Re: CPS and Guile

2012-02-19 Thread Andy Wingo
Hi, On Sat 18 Feb 2012 17:42, Noah Lavine writes: > Why not make dynlet, dynwind, dynref, dynset, prompt, and abort into > primitives? Code that cares can still match them, and code that > doesn't care can ignore them. In the case of dynlet, there is an efficiency concern: you already have the

Re: manual examples - self contained or not?

2012-02-19 Thread Andy Wingo
On Sun 19 Feb 2012 17:42, Ian Price writes: > With the obvious exception of examples whose entire purpose is to show > off the module system, and similar, I think we should adopt a consistent > policy one way or the other, and adapt all the examples to it. FWIW, I agree. > My vote would be for

Re: Trouble using (current-filename)

2012-02-19 Thread Andy Wingo
On Sun 19 Feb 2012 22:02, l...@gnu.org (Ludovic Courtès) writes: >> See Neil's use case here: >> >> http://thread.gmane.org/gmane.lisp.guile.devel/13440/focus=13621 >> >> Can we do something that makes sense for both cases? > > Well, (add-to-load-path (dirname (canonicalize-path (current-filenam

Re: allocation within critical sections

2012-02-19 Thread Andy Wingo
On Sun 19 Feb 2012 21:56, l...@gnu.org (Ludovic Courtès) writes: >>> What about using asyncs for that? For instance, scm_i_finalize_smob >>> make a [deferred], instead of direct, call to the SMOB’s ‘free’, via >>> scm_i_queue_async_cell. >> >> It's an interesting idea. I suspect that it only def

Re: Trouble using (current-filename)

2012-02-19 Thread Noah Lavine
What about having two bits of syntax, current-filename and current-file-path? Or better yet, current-filename and current-file-directory, with the guarantee that (string-append (current-file-directory) path-separator (current-filename)) points to the file when it was compiled? It is more intuitive