Myrosia Dzikovska | 22 Oct 2009 16:20
Picon

Returning a string from a LISP callable

Hello,

I am trying to put together an application in ACL 8.0 where a C++
server periodically calls into LISP (I am integrating with a C++
communications library). It needs to pass a string (char*) argument
into LISP, and return a string (char*) as well.

I can make the callables that pass in a string to LISP, and return
nothing, work. But I cannot return a string sensibly.

So far, I have tried a :returning declaration in
defun-foreign-callable, and setting the convert-to-c-types parameter
in register-foreign-callable to t. In both cases, a null pointer was
returned. I also tried setting a global LISP variable to the return
string value, and accessing it with lisp_value from C. I could not
figure out how the macros in lisp.h work, so the several combinations
I have tried either don't compile, or return a segmentation violation.

If someone could provide me with an example of how this can be done, I
would very much appreciate it.

Myrosia

Pascal Costanza | 6 Sep 2009 22:39

Weird CLOS MOP behavior

Hi,

This is on Allegro 8.1 on Mac OS X.

Assume I have the following definitions:

(use-package :clos)

(defclass my-generic-function (standard-generic-function)
   ()
   (:metaclass funcallable-standard-class))

(defmethod compute-discriminating-function ((mf my-generic-function))
   (let ((disc (call-next-method)))
     (lambda (&rest args)
       (print args)
       (apply disc args))))

(defgeneric foo (x y z)
   (:method (x y z) (+ x y z))
   (:generic-function-class my-generic-function))

If I load and test these definitions, I get the following output:

CL-USER(1): (load "clos-test")
; Fast loading /Users/costanza/Muell/clos.fasl

(#<Closure (:INTERNAL
             (METHOD COMPUTE-DISCRIMINATING-FUNCTION
              (MY-GENERIC-FUNCTION))
(Continue reading)

phil | 18 Aug 2009 16:26
Picon

auto load after start

Hello,

I have a simple question. I just want to load a lisp file
automatically after start up. Important is, that the package
COMMON-GRAPHICS-USER has already been loaded. By using the attribute
-L the file will be loaded with the COMMON-LISP-USER package, which
won't work with my lisp file. What can I do?

Thanks for help,
Phil

Arthur Lemmens | 7 Aug 2009 15:14
Picon
Picon
Favicon

European Common Lisp Meeting

Hi,

We just want to remind you that the registration deadline for this year's
ECLM (European Common Lisp Meeting) is August 15.  You can still register
at

  http://weitz.de/eclm2009

We hope to see you in Hamburg,

Edi Weitz & Arthur Lemmens

jcb | 29 Jul 2009 11:28
Picon
Favicon

macro for export-xml-rpc-method

Okay this is driving me nuts. 

The signature of export-xml-rpc-method is:

(export-xml-rpc-method server '("method1" method1) :int :int :int)

Where  ":int :int :int" can be a variable number of arguments. 

Instead of coding 90 gazillion calls to export-xml-rpc-method, I would like to 
have one call that is fed by a list of exported methods and their return 
types and argument types:

(defparameter *my-methods* 
    '((("wg-base.foo" foo) :struct :string :int :string :string)
      (("wg-base.bar" bar) :int :struct)
      (("wg-base.barf" barf) :array)))

I have fiddled unsuccessfully with the following:

(defmacro call-export (server method-spec types-list)
   `(export-xml-rpc-method ,server ',method-spec , <at> types-list))

(defun export-my-methods (server)
  (mapcar #'lambda (exported-method)
                                      (destructuring-bind (method &rest types) exported-method
                                         (call-export server method types))) *my-methods*))

...which does not compile. 

Is there a way to do this or am I completely crazy for even trying...???  
(Continue reading)

Andrew Wolven | 14 Apr 2009 02:57
Picon
Favicon

Fw: ACL 8.1 XP/Emacs 22.3.1/format/fi:compile-buffer strange behavior

It does it on my machine too.
 
I haven't really investigated it much, but when you compile emacs is sending the code over lep::*connection*  which has an external format of #<external-format :emacs-mule-base [(crlf-base-ef :emacs-mule)] <at>   #x...>, while the stream you are doing the write-line to probably has an external format of #<external-format :|1252| ['(:e-crlf :1252-base)] <at> #x...>.  Maybe there is some difference there.  Just guessing though.
 
-Andrew Wolven

----- Forwarded Message ----
From: "Watton, John D." <John.Watton <at> alcoa.com>
To: allegro-cl <at> franz.com
Sent: Monday, April 13, 2009 1:33:15 PM
Subject: ACL 8.1 XP/Emacs 22.3.1/format/fi:compile-buffer strange behavior

I have the following function below which in my mind should write two identical files, eol1.txt and eol2.txt. For me the files are not identical when the function is compiled in Emacs 22.3.1 (the one for download on the Franz website), using fi:compile-buffer or C-c C-x. The file eol2.txt which uses format has extra carriage-returns. On the other hand if I use compile-file/load-file, or an older version of Emacs the written files are identical as expected without extra carriage-returns.

 

I have submitted this problem to support <at> franz.com and it has been assigned spr35666, but they were not able to reproduce it. Hopefully, someone else has a suggestion as to a solution. Or can at least reproduce it. It is driving me nuts.

 

(defun test-eol ()

  (let* ((file1 "~/eol1.txt")

                 (file2 "~/eol2.txt")          )

    (with-open-file (stream file1 :direction :output :if-exists :supersede)

      (write-line "Line One" stream)

      (write-line "Line Two" stream)

      (write-line "Line Three" stream))

   

    (with-open-file (stream file2 :direction :output :if-exists :supersede)

      (format stream "Line One

Line Two

Line Three~%"))))

 

 

______________________________________

John Watton, PhD

Computational and Simulation Modeling Section

Alcoa Technical Center

724-337-2165

 


Watton, John D. | 13 Apr 2009 20:33
Picon
Favicon

ACL 8.1 XP/Emacs 22.3.1/format/fi:compile-buffer strange behavior

I have the following function below which in my mind should write two identical files, eol1.txt and eol2.txt. For me the files are not identical when the function is compiled in Emacs 22.3.1 (the one for download on the Franz website), using fi:compile-buffer or C-c C-x. The file eol2.txt which uses format has extra carriage-returns. On the other hand if I use compile-file/load-file, or an older version of Emacs the written files are identical as expected without extra carriage-returns.

 

I have submitted this problem to support <at> franz.com and it has been assigned spr35666, but they were not able to reproduce it. Hopefully, someone else has a suggestion as to a solution. Or can at least reproduce it. It is driving me nuts.

 

(defun test-eol ()

  (let* ((file1 "~/eol1.txt")

                 (file2 "~/eol2.txt")          )

    (with-open-file (stream file1 :direction :output :if-exists :supersede)

      (write-line "Line One" stream)

      (write-line "Line Two" stream)

      (write-line "Line Three" stream))

   

    (with-open-file (stream file2 :direction :output :if-exists :supersede)

      (format stream "Line One

Line Two

Line Three~%"))))

 

 

______________________________________

John Watton, PhD

Computational and Simulation Modeling Section

Alcoa Technical Center

724-337-2165

 

jacques rattier | 7 Apr 2009 05:00
Picon
Favicon

permanent connection MySql with Allegro

Hello
I'm using Allegro Mysql direct connect library.
I use connect to connect to mysql database.

Is there a possibility to make a persistant connection (as it is possible in PHP with mysql_pconnnect) ?
Thank you for your help

--
Jacques

Kevin Layer | 27 Feb 2009 01:28
Picon
Favicon

Re: Font locking in emacs 22.2.1

I've sent the fix to Myrosia, but thought I should inform the list
that the solution is:

  (add-hook 'fi:inferior-common-lisp-mode-hook 'fi::turn-on-font-lock)

This will be part of an upcoming ELI patch.

--

-- 
Kevin Layer             layer <at> Franz.COM        http://www.franz.com/
Franz Inc., 2201 Broadway, Suite 715, Oakland, CA 94612, USA
Phone: (510) 452-2000   FAX: (510) 452-0182

Michael Chan | 17 Feb 2009 05:22
Picon

Problem loading C++ shared objects [urgent]

Hi,

I'm having problems trying to load a C++ shared object. At the moment, I'm just using the :ld top level command ":ld base64.so", where base64.so is the C++ shared object. The error I get is:

; Foreign loading /home/mchan/inka/lisp/inka/binaries/I486-ALLEGRO-8-1/base64.so.
Error: Loading
       /home/mchan/inka/lisp/inka/binaries/I486-ALLEGRO-8-1/base64.so
       failed with error:
       /home/mchan/inka/lisp/inka/binaries/I486-ALLEGRO-8-1/base64.so: undefined symbol: __gxx_personality_v0.
  [condition type: FILE-ERROR]

It seems to me the error is caused by a mix up between C++ and C code. Am I missing some argument for indicating the true file type? How should I do this if I use the "load" function?

Any help will be much appreciated.

Regards,
Michael

Picon
Favicon

WEBACTIONS AND DOWNLOAD FILES

A webactions question...

I want to let my users download a file whose contents are dynamic. It's easy
enough to build the file and I can include a reference to it in my generated
HTML (so I can point to the unique filename that I'm using for this
particular user/session). But I don't have a map for it, if for no other
reason than the filename is dynamic, too. Putting the file into a
pre-defined filename isn't good... Different users' requests will result in
different records in the output file (it's basically a query response). I
can show the generated content in a table, no problem, but I want to offer
the option for the user to download the content so it can be imported into
some other tools.

So I guess if I could modify the map on the fly I could make it work but I
don't see a handle for the map in the documentation.

Random experimentation tends to take too long.

Hints, thoughts, or alternatives are welcome...

VR/
Mark L. Williams
Attachment (smime.p7s): application/x-pkcs7-signature, 4954 bytes

Gmane