chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] how to do (current-load-port) in chicken? (Modified


From: felix winkelmann
Subject: Re: [Chicken-users] how to do (current-load-port) in chicken? (Modified by Rick Taube)
Date: Thu, 7 Apr 2005 13:40:36 +0200

On Apr 7, 2005 1:32 PM, Rick Taube <address@hidden> wrote:
> 
> thank you, but this will not work in the context of a file that is
> loaded into all schemes:
> 
> (let ((this-file #f))
>    (cond-expand
>     (guile
>      (set! this-file (port-filename (current-load-port))))
>     (gauche
>      (set! this-file (port-name (current-load-port))))
>     (chicken
>      (set! this-file ##sys#current-load-file)))
>    this-file)
> h
> because the ## dispatch is expanded in all lisps, not just chicken.
> im sorry im brand new to chicken -- is there some way to access this
> variable without using read-time expansion?
> 

Ah, ok - in this case, try:

(eval (with-input-from-string "##sys#current-load-file" read))

[string->symbol wouldn't work, because of the special syntax]

I probably should provide a somewhat more user-friendly interface 
to this...


cheers,
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]