Marco Antoniotti | 1 Feb 14:16
Picon

ELS 2012, Zadar, Croatia

Apologies for the multiple postings. 

PAPER SUBMISSION DEADLINE EXTENDED 

European Lisp Symposium 2012, Zadar, Croatia, April 30th - May 1st, 2012 

http://european-lisp-symposium.org 

The purpose of the European Lisp Symposium is to provide a forum for 
the discussion and dissemination of all aspects of design, 
implementation and application of any of the Lisp and Lisp-inspired 
dialects, including Common Lisp, Scheme, Emacs Lisp, AutoLisp, ISLISP, 
Dylan, Clojure, ACL2, ECMAScript, Racket, SKILL, and so on. We 
encourage everyone interested in Lisp to participate. 

The main theme of the 2012 European Lisp Conference is 
"Interoperability: Systems, Libraries, Workflows".  Lisp based and 
functional-languages based systems have grown a variety of solutions 
to become more and more integrated with the wider world of Information 
and Communication Technologies in current use.  There are several 
dimensions to the scope of the solutions proposed, ranging from 
"embedding" of interpreters in C-based systems, to the development of 
abstractions levels that facilitate the expression of complex context 
dependent tasks, to the construction of exchange formats handling 
libraries, to the construction of theorem-provers for the "Semantic 
Web".  The European Lisp Symposium 2012 solicits the submission of 
papers with this specific theme in mind, alongside the more 
traditional tracks which have appeared in the past editions. 

We invite submissions in the following forms: 
(Continue reading)

Mirko Vukovic | 3 Feb 18:30
Picon

how to access a stream's file descriptor

Hello,

when I print a stream associated with an open file, I can see the file name there.

How can I query the stream to get the associated file name?

(I did look in the manual, and looked under sb-sys, but found nothing.)

Thank you,

Mirko

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Kalyanov Dmitry | 3 Feb 18:41
Picon
Gravatar

Re: how to access a stream's file descriptor

Hello,

On Fri, 2012-02-03 at 12:30 -0500, Mirko Vukovic wrote:
> Hello,
> 
> when I print a stream associated with an open file, I can see the file
> name there.
> 
> How can I query the stream to get the associated file name?
> 
> (I did look in the manual, and looked under sb-sys, but found
> nothing.)
> 

SBCL's file streams are instances of SB-SYS:FD-STREAM.

You can query a file stream for FD (file descriptor) and file name like
this:

(with-open-file (file "/home/dvk/1.xml")
  (values (sb-sys:fd-stream-fd file)
          (pathname file)))
=>
5
#P"/home/dvk/1.xml"

According to CLHS, (pathname stream) returns the filename of a stream
(the pathname that was used to open it). SB-SYS:FD-STREAM-FD is an
SBCL-specific function.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
Martin Buchmann | 12 Feb 22:02

Problem creating a swank server from my .sbclrc file

Hi all,

I want to define an easy way to start sbcl on a remote machine running SLIME's swank server as described in the
SLIME manual [1]. Because I do not want to type all the commands over and over again, I thought of a solution
similar to the way linedit is invoked [2], i.e. define some command line argument in my .sbclrc file which
load swank-loader and creates the server, etc.

I started with this and its working fine. If I invoke sbcl with the option "--swank" the message is printed in
the repl and I can invoke the command '(swank-loader:init)' in it. 

(when (member "--swank" sb-ext:*posix-argv* :test 'equal)
  (setf sb-ext:*posix-argv* 
	(remove "--swank" sb-ext:*posix-argv* :test 'equal))
  (load "/path/to/swank-loader.lisp") ;; or (asdf:operate 'asdf:load-op 'swank) ; with same result
  (print "Loading Swank..."))

Of course, this is a bit pointless because I want to add '(swank-loader:init)', etc. also to my .sbclrc
file. But when I try this I get the following error even if I do not add "--swank" to the invocation of sbcl.

> debugger invoked on a SB-KERNEL:SIMPLE-PACKAGE-ERROR:
>   The name "SWANK-LOADER" does not designate any package.
> 
> Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
> 
> restarts (invokable by number or by possibly-abbreviated name):
>   0: [ABORT] Abort userinit file "/Users/Martin/.sbclrc".
>   1:         Skip to toplevel READ/EVAL/PRINT loop.
>   2: [QUIT ] Quit SBCL (calling #'QUIT, killing the process).
> 
> (SB-INT:%FIND-PACKAGE-OR-LOSE "SWANK-LOADER")
> 0] 

I have no idea why the package swank-loader causes problems even if the body of the when macro shouldn't
matter. Maybe I am missing something about macro evaluation here. Nevertheless, I would love to know how I
can utilize my basic idea of saving typing while invoking sbcl on a remote machine with SLIME's
swank-server already running.

I found similar solutions using Google, e.g. [3] but ended up with the same problem.

How can I include the actual creation of the swank server in my .sbclrc?

Best regards
  Martin

[1] http://common-lisp.net/project/slime/doc/html/Setting-up-the-lisp-image.html#fnd-1
[2] http://common-lisp.net/project/linedit/
[3] http://archgeek.wordpress.com/2009/02/07/setting-up-slime-emacs-and-sbcl/

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Stas Boukarev | 12 Feb 22:10
Picon

Re: Problem creating a swank server from my .sbclrc file

Martin Buchmann <martin.buchmann <at> googlemail.com> writes:

> Hi all,
>
> I want to define an easy way to start sbcl on a remote machine running SLIME's swank server as described in
the SLIME manual [1]. Because I do not want to type all the commands over and over again, I thought of a
solution similar to the way linedit is invoked [2], i.e. define some command line argument in my .sbclrc
file which load swank-loader and creates the server, etc.
>
> I started with this and its working fine. If I invoke sbcl with the option "--swank" the message is printed
in the repl and I can invoke the command '(swank-loader:init)' in it. 
>
> (when (member "--swank" sb-ext:*posix-argv* :test 'equal)
>   (setf sb-ext:*posix-argv* 
> 	(remove "--swank" sb-ext:*posix-argv* :test 'equal))
>   (load "/path/to/swank-loader.lisp") ;; or (asdf:operate 'asdf:load-op 'swank) ; with same result
>   (print "Loading Swank..."))
>
> Of course, this is a bit pointless because I want to add '(swank-loader:init)', etc. also to my .sbclrc
file. But when I try this I get the following error even if I do not add "--swank" to the invocation of sbcl.
Use (funcall (read-from-string "swank-loader:init")).

> I have no idea why the package swank-loader causes problems even if
> the body of the when macro shouldn't matter. Maybe I am missing
> something about macro evaluation here. Nevertheless, I would love to
> know how I can utilize my basic idea of saving typing while invoking
> sbcl on a remote machine with SLIME's swank-server already running.
That's not about macros. The error happens at read-time. The whole WHEN
form is read at once, and SWANK-LOADER package doesn't exist at that
time.

--

-- 
With best regards, Stas.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Martin Buchmann | 13 Feb 20:03

Re: Problem creating a swank server from my .sbclrc file

Stas,

thanks for our reply. That was exactly want I wanted. 

Best regards
  Martin

Am 12.02.2012 um 22:10 schrieb Stas Boukarev:

> Martin Buchmann <martin.buchmann <at> googlemail.com> writes:
> 
>> Hi all,
>> 
>> I want to define an easy way to start sbcl on a remote machine running SLIME's swank server as described in
the SLIME manual [1]. Because I do not want to type all the commands over and over again, I thought of a
solution similar to the way linedit is invoked [2], i.e. define some command line argument in my .sbclrc
file which load swank-loader and creates the server, etc.
>> 
>> I started with this and its working fine. If I invoke sbcl with the option "--swank" the message is printed
in the repl and I can invoke the command '(swank-loader:init)' in it. 
>> 
>> (when (member "--swank" sb-ext:*posix-argv* :test 'equal)
>>  (setf sb-ext:*posix-argv* 
>> 	(remove "--swank" sb-ext:*posix-argv* :test 'equal))
>>  (load "/path/to/swank-loader.lisp") ;; or (asdf:operate 'asdf:load-op 'swank) ; with same result
>>  (print "Loading Swank..."))
>> 
>> Of course, this is a bit pointless because I want to add '(swank-loader:init)', etc. also to my .sbclrc
file. But when I try this I get the following error even if I do not add "--swank" to the invocation of sbcl.
> Use (funcall (read-from-string "swank-loader:init")).
> 
>> I have no idea why the package swank-loader causes problems even if
>> the body of the when macro shouldn't matter. Maybe I am missing
>> something about macro evaluation here. Nevertheless, I would love to
>> know how I can utilize my basic idea of saving typing while invoking
>> sbcl on a remote machine with SLIME's swank-server already running.
> That's not about macros. The error happens at read-time. The whole WHEN
> form is read at once, and SWANK-LOADER package doesn't exist at that
> time.
> 
> -- 
> With best regards, Stas.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
Myrosia Dzikovska | 17 Feb 13:36
Picon

Moving to sbcl from Allegro CL: calling LISP from C?

Hi,

I am considering moving to sbcl from Allegro CL. I work on a project
that involves a bunch of components written in different languages,
communicating using ICE middleware (http://www.zeroc.com). There is no
"native" ICE interface for LISP, and none is planned anytime soon.
There are C and Python interfaces. The protocol requirements are
complex enough that I don't have time to implement these in LISP.

My solution so far has been as follows: have the ICE server code
running in C++, accepting requests. When a request comes in, the C
code calls a lisp call handler, eventually gets the results back, and
passes them to the caller. Calling LISP from C is possible, if
awkward, in Allegro CL.

Sbcl manual says that calling LISP from C is hackish and poorly
supported, and does not provide any detail. In practice, doing this in
ACL is extremely hackish as well, with various issues and
restrictions. But it was documented enough for me to make it work.

Has anyone had any experience with calling lisp from C in sbcl? I'd
like to know if this is worth my time, or I should look for a
different LISP distribution. I'd consider alternatives to directly
calling LISP from C, e.g., if it would be possible to have a thread
sleeping in LISP and woken up from C (but it's not obvious to me that
it would work from the manuals, either).

Thanks,

Myrosia

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Akshay Srinivasan | 17 Feb 13:39
Picon

Re: Moving to sbcl from Allegro CL: calling LISP from C?

On 02/17/2012 06:06 PM, Myrosia Dzikovska wrote:
> Hi,
>
> I am considering moving to sbcl from Allegro CL. I work on a project
> that involves a bunch of components written in different languages,
> communicating using ICE middleware (http://www.zeroc.com). There is no
> "native" ICE interface for LISP, and none is planned anytime soon.
> There are C and Python interfaces. The protocol requirements are
> complex enough that I don't have time to implement these in LISP.
>
> My solution so far has been as follows: have the ICE server code
> running in C++, accepting requests. When a request comes in, the C
> code calls a lisp call handler, eventually gets the results back, and
> passes them to the caller. Calling LISP from C is possible, if
> awkward, in Allegro CL.
>
>
> Sbcl manual says that calling LISP from C is hackish and poorly
> supported, and does not provide any detail. In practice, doing this in
> ACL is extremely hackish as well, with various issues and
> restrictions. But it was documented enough for me to make it work.
>
> Has anyone had any experience with calling lisp from C in sbcl? I'd
> like to know if this is worth my time, or I should look for a
> different LISP distribution. I'd consider alternatives to directly
> calling LISP from C, e.g., if it would be possible to have a thread
> sleeping in LISP and woken up from C (but it's not obvious to me that
> it would work from the manuals, either).

Have you tried using CFFI ? CFFI provides macros for defining callbacks; but more importantly provides a uniform API between different lisp implementations for interfacing with foreign code.

Akshay


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Myrosia Dzikovska | 17 Feb 16:51
Picon

Re: Moving to sbcl from Allegro CL: calling LISP from C?

On Fri, Feb 17, 2012 at 12:39 PM, Akshay Srinivasan
<akshaysrinivasan <at> gmail.com> wrote:
>> it would work from the manuals, either).
> Have you tried using CFFI ? CFFI provides macros for defining callbacks; but
> more importantly provides a uniform API between different lisp
> implementations for interfacing with foreign code.
>
> Akshay
>
>

Thanks! That library looks very interesting, especially from the point
of view of interoperability. But the docs don't say much
about callback in sbcl: "Not all platforms support callbacks." So that
doesn't help me decide whether sbcl is going to work at all.

Someone else suggested in private mail that I try a pipe trick, with
LISP polling a pipe stream, and C writing notifications as necessary.
That's the option I'd go for, I think. If I can make it work with
CFFI, even better ;-)

Myrosia

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Akshay Srinivasan | 17 Feb 16:53
Picon

Re: Moving to sbcl from Allegro CL: calling LISP from C?

On 02/17/2012 09:21 PM, Myrosia Dzikovska wrote:
On Fri, Feb 17, 2012 at 12:39 PM, Akshay Srinivasan <akshaysrinivasan <at> gmail.com> wrote:
it would work from the manuals, either).
Have you tried using CFFI ? CFFI provides macros for defining callbacks; but more importantly provides a uniform API between different lisp implementations for interfacing with foreign code. Akshay
Thanks! That library looks very interesting, especially from the point of view of interoperability. But the docs don't say much about callback in sbcl: "Not all platforms support callbacks." So that doesn't help me decide whether sbcl is going to work at all.
I use CFFI with SBCL; it does work :)
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help

Gmane