[Ecls-list] Two small problems with ECL 15.2.21 on Windows

2015-02-25 Thread Polos Ruetz
Hi,

just wanted to report two small problems with new ECL 15.2.21 on Windows,
using the MSVC (2008/2010) compilers:

(1) File ecl/src/c/file.d needs this patch in order to compile:


diff --git a/_file.d b/file.d
index 578cc27..8427b3b 100755
--- a/_file.d
+++ b/file.d
@@ -2773,12 +2773,12 @@ io_file_length(cl_object strm)
 static cl_object
 io_file_get_position(cl_object strm)
 {
-   int f = IO_FILE_DESCRIPTOR(strm);
-if (isatty(f)) return(ECL_NIL);
-
cl_object output;
ecl_off_t offset;

+   int f = IO_FILE_DESCRIPTOR(strm);
+if (isatty(f)) return(ECL_NIL);
+
ecl_disable_interrupts();
offset = lseek(f, 0, SEEK_CUR);
ecl_enable_interrupts();
@@ -2810,10 +2810,10 @@ io_file_get_position(cl_object strm)
 static cl_object
 io_file_set_position(cl_object strm, cl_object large_disp)
 {
-   int f = IO_FILE_DESCRIPTOR(strm);
-if (isatty(f)) return(ECL_NIL);
ecl_off_t disp;
int mode;
+   int f = IO_FILE_DESCRIPTOR(strm);
+if (isatty(f)) return(ECL_NIL);
if (Null(large_disp)) {
disp = 0;
mode = SEEK_END;


(2) Starting up ECL in a Windows console gives this error; as you can
see, it's simply a problem with character encoding of the name of the
new maintainer:


ECL (Embeddable Common-Lisp) 15.2.21 (git:UNKNOWN)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
Copyright (C) 2015 Daniel Kochma
Condition of type: STREAM-ENCODING-ERROR
encoding error on stream #i/o win32 console stream stdout (:EXTERNAL-FORMAT
...
Available restarts:

1. (CONTINUE) Ignore character
2. (USE-VALUE) Store a different character code.

Top level in: #process TOP-LEVEL.



--

Paul

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


[Ecls-list] Two small problems with ECL 15.2.21 on Windows

2015-02-25 Thread Polos Ruetz
Hi,

just reporting two small problems with new ECL 15.2.21 on Windows,
using the MSVC (2008/2010) compilers:

(1) File ecl/src/c/file.d needs this patch to compile correctly (see
also attachment):


diff --git a/_file.d b/file.d
index 578cc27..8427b3b 100755
--- a/_file.d
+++ b/file.d
@@ -2773,12 +2773,12 @@ io_file_length(cl_object strm)
 static cl_object
 io_file_get_position(cl_object strm)
 {
-   int f = IO_FILE_DESCRIPTOR(strm);
-if (isatty(f)) return(ECL_NIL);
-
cl_object output;
ecl_off_t offset;

+   int f = IO_FILE_DESCRIPTOR(strm);
+if (isatty(f)) return(ECL_NIL);
+
ecl_disable_interrupts();
offset = lseek(f, 0, SEEK_CUR);
ecl_enable_interrupts();
@@ -2810,10 +2810,10 @@ io_file_get_position(cl_object strm)
 static cl_object
 io_file_set_position(cl_object strm, cl_object large_disp)
 {
-   int f = IO_FILE_DESCRIPTOR(strm);
-if (isatty(f)) return(ECL_NIL);
ecl_off_t disp;
int mode;
+   int f = IO_FILE_DESCRIPTOR(strm);
+if (isatty(f)) return(ECL_NIL);
if (Null(large_disp)) {
disp = 0;
mode = SEEK_END;


(2) Starting up ECL in a Windows console gives this error (as you can
see, it's simply a problem with character encoding of the name of the
new maintainer):


ECL (Embeddable Common-Lisp) 15.2.21 (git:UNKNOWN)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
Copyright (C) 2015 Daniel Kochma
Condition of type: STREAM-ENCODING-ERROR
encoding error on stream #i/o win32 console stream stdout (:EXTERNAL-FORMAT
...
Available restarts:

1. (CONTINUE) Ignore character
2. (USE-VALUE) Store a different character code.

Top level in: #process TOP-LEVEL.



--

Paul
diff --git a/_file.d b/file.d
index 578cc27..8427b3b 100755
--- a/_file.d
+++ b/file.d
@@ -2773,12 +2773,12 @@ io_file_length(cl_object strm)
 static cl_object
 io_file_get_position(cl_object strm)
 {
-   int f = IO_FILE_DESCRIPTOR(strm);
-if (isatty(f)) return(ECL_NIL);
-
cl_object output;
ecl_off_t offset;
 
+   int f = IO_FILE_DESCRIPTOR(strm);
+if (isatty(f)) return(ECL_NIL);
+
ecl_disable_interrupts();
offset = lseek(f, 0, SEEK_CUR);
ecl_enable_interrupts();
@@ -2810,10 +2810,10 @@ io_file_get_position(cl_object strm)
 static cl_object
 io_file_set_position(cl_object strm, cl_object large_disp)
 {
-   int f = IO_FILE_DESCRIPTOR(strm);
-if (isatty(f)) return(ECL_NIL);
ecl_off_t disp;
int mode;
+   int f = IO_FILE_DESCRIPTOR(strm);
+if (isatty(f)) return(ECL_NIL);
if (Null(large_disp)) {
disp = 0;
mode = SEEK_END;
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


[Ecls-list] EQL (ECL + Qt) in Slime: how it works

2014-12-11 Thread Polos Ruetz
Hi,

this might be of common interest for ECL users, so please see attached
file if you want to know more.

Cheers,

Paul



EQL (ECL + Qt) in Slime -- how does it work?

  Start swank using the EQL executable, running the swank server in an ECL thread, and using the main thread for the Qt main event loop.
  Wrap every internal EQL function in a macro, which will call the function either directly (if called from GUI/main thread), or, if called from another ECL thread, will wrap the function call in a closure.
  This closure will be passed to a queued, blocking Qt function running in the GUI thread, which will in turn call the closure.

The crucial part is passing a Lisp closure from an ECL thread to Qt and calling it from C++ in the GUI/main thread.
This is trivial in ECL/Qt, since both ECL and Qt use/wrap native C threads, and Qt offers a nice utility with Q_INVOKABLE.
First let's wrap the actual Lisp function, e.g. (foo x y) in a closure, so we only need to pass one ECL closure pointer to C++.
No need to pass Lisp arguments to C++, they are in the closure; no return value needed from C++, Lisp return values will be assigned in the closure:


  ;; in some ECL thread
  (let (values)
(run-in-gui-thread

  ;; in ECL main/GUI thread
  (lambda ()
(setf values (multiple-value-list (foo x y)

;; back in some ECL thread
(values-list values))


Here the implementation of the ECL function run-in-gui-thread (embedded in Qt):


  cl_object run_in_gui_thread(cl_object closure) // define ECL function
  {
  QMetaObject::invokeMethod(
  caller,   // any object from GUI thread
  "runInGuiThread", // see Q_INVOKABLE
  Qt::BlockingQueuedConnection, // blocking for return values
  Q_ARG(void*, closure));   // 'closure' is just a pointer

  return Cnil;
  }


Now the Lisp closure will run in the GUI/main thread, and the implementation of the Qt function runInGuiThread is as simple as:


  Q_INVOKABLE void runInGuiThread(void* closure) // note Q_INVOKABLE
  {
  cl_funcall(1, (cl_object)closure); // ECL function call
  }


After introducing a macro qrun*, and wrapping all EQL functions int it (see "slime/thread-safe.lisp"), we are done!
(Please note that the above code is a stripped down version, see sources for the
actual implementation.)



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] documentation function

2012-09-10 Thread Polos Ruetz
2012/9/9, red plait redpl...@gmail.com:
 (documentation 'cons 'function)

 ;;; Loading #PC:/src/ecl/ecl/msvc/ecl-help.asd

This works fine for me (on all platforms), but I noticed that for me,
it shows Loading ...ecl-help.fas, not Loading ...ecl-help.asd.

(If I try to manually load ...ecl-help.asd, I get a similar error to yours.)

Did you change the ECL_ASDF option in your msvc/Makefile? The default
setting just works (that is, the ASDF coming with ECL).

Paul

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Slime question: running swank in thread: Linux :) Windows :(

2012-08-18 Thread Polos Ruetz
2012/8/18, Juan Jose Garcia-Ripoll juanjose.garciarip...@gmail.com:
 The problem was with LISTEN. On Windows sockets it was broken and returned
 true when it shouldn't.

 Slime now works for me on the Windows box (MSVC port).

Thanks, confirmed: it works for me too!

Paul

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] unicode troubles

2012-07-22 Thread Polos Ruetz
2012/7/22, Арсений Заостровных necto...@gmail.com:
 std::string outStr = (char*)princed-base_string.

This code is taken from EQL and converts from/to a QString.
(But maybe there's a better way.)

cl_object from_qstring(const QString s)
{
cl_object l_s = ecl_alloc_simple_extended_string(s.length());
ecl_character* l_p = l_s-string.self;
for(int i = 0; i  s.length(); ++i) {
l_p[i] = s.at(i).unicode();
}
return l_s;
}


QString toQString(cl_object l_str)
{
QString s;
if(ECL_STRINGP(l_str)) {
if(ECL_BASE_STRING_P(l_str)) {
s = QString::fromLatin1((char*)l_str-base_string.self,
l_str-base_string.fillp);
}
else {
uint l = l_str-string.fillp;
s.reserve(l);
ecl_character* l_s = l_str-string.self;
for(uint i = 0; i  l; ++i) {
s[i] = QChar(l_s[i]);
}
}
}
return s;
}

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Need Help compile-file didn't call VC compiler

2011-04-16 Thread Polos Ruetz
2011/4/16, 邱涛 qiutao...@hotmail.com:
 When I (compile-file hello.lisp) the message is
 ;;; Compiling hello.lispHello world!
 #Phello.fasb

Put this in your ECL ini file (.eclrc):

 (require :cmp)

Paul

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


[Ecls-list] ECL HEAD now compiles Embedded Qt Lisp

2010-10-29 Thread Polos Ruetz
Just letting you know that the Embedded Qt Lisp EQL
(http://gitorious.org/eql/eql) now compiles fine with the current ECL
HEAD.

(For the interested: I needed to insert the macro definition from
SERVE-EVENT:WITH-FD-HANDLER in the file src/lisp/ini.lisp, otherwise
it didn't compile. Since I do some non standard things in the EQL
tool, this hack seems necessary to make the compiler aware of the
above mentioned macro.)

Paul

--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] ECL HEAD now compiles Embedded Qt Lisp

2010-10-29 Thread Polos Ruetz
2010/10/29, Juan Jose Garcia-Ripoll juanjose.garciarip...@googlemail.com:
 Did you name it serve-event:with-fd-handler? Did you use (require
 'serve-event) before building the library? One may list serve-event and
 sockets among the modules that are linked together with ECL using
 --with-sockets=builtin --with-serve-event=builtin etc etc

Thanks for the hints! I named it serve-event:with-fd-handler, yes, but
I didn't do any require or similar...

In short: I saw this nice possibility to add an interactive top-level
using serve-event (at least for Unix based OSs, even without SLIME),
and simply did some brute-force to make it work.
Today I tried to find the reason of the compile failure with current
ECL, and it was in fact quite trivial...

I will do some revision and clean up some parts.

Paul

--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list