elliott | 2 Jun 17:45 2008
Picon

receiving signed integers

Hi,

I've reached a point in writing some code where I must read a singed 
32bit integer from a socket.  I've been using NET.SOCKETS:RECEIVE-FROM 
to read '(unsigned-byte 8) values.  Can anyone suggest a good library 
(or alternate method) to help with the conversion?

elliott
Marko Tapio Manninen | 2 Jun 23:01 2008
Picon

series related error on loading iolib (openmcl 64bit)

Hi,

i got this error, when trying to load iolib:

No MAKE-LOAD-FORM method is defined for #<CCL::SIMPLE-PROGRAM-ERROR  
#x3000413AE9BD>
    [Condition of type SIMPLE-ERROR]

Backtrace:
   0: (CCL::NO-MAKE-LOAD-FORM-FOR #<CCL::SIMPLE-PROGRAM-ERROR  
#x3000413AE9BD>)
       Locals:
         CCL::OBJECT = #<CCL::SIMPLE-PROGRAM-ERROR #x3000413AE9BD>
   1: (CCL::FASL-SCAN-USER-FORM #<CCL::SIMPLE-PROGRAM-ERROR  
#x3000413AE9BD>)
       [No Locals]
   2: (CCL::FASL-SCAN-CLFUN #<Anonymous Function #x3000413AE92F>)
       Locals:
         CCL::F = #<Anonymous Function #x3000413AE92F>
         CCL::NCODE-WORDS = 9
   3: (CCL::FASL-SCAN-CLFUN #<Anonymous Function #x3000413AE09F>)
       Locals:
         CCL::F = #<Anonymous Function #x3000413AE09F>
         CCL::NCODE-WORDS = 18
   4: (CCL::FASL-SCAN '((23 83) (47 "home:lisp;libs;series-2.2.9;s- 
code.lisp.newest")
        (4 #<Anonymous Function #x30004121A8FF>)
        (41 SERIES:*SUPPRESS-SERIES-WARNINGS* NIL
         "Suppress warnings when the restrictions are violated.")
        (41 SERIES:*SERIES-EXPRESSION-CACHE* T
(Continue reading)

Stelian Ionescu | 3 Jun 09:43 2008
Picon

Re: receiving signed integers

On Mon, Jun 02, 2008 at 08:45:37AM -0700, elliott wrote:
>Hi,
>
>I've reached a point in writing some code where I must read a singed 
>32bit integer from a socket.  I've been using 
>NET.SOCKETS:RECEIVE-FROM to read '(unsigned-byte 8) values.  Can 
>anyone suggest a good library (or alternate method) to help with the 
>conversion?

I'm afraid that you'll have to do manual conversion for the moment until
I'll add the proper routines to write into arrays other than
'(unsigned-byte 8). Here's a piece of code that can do just that,
albeit slowly.

(defun aref-32 (ub8-array &optional (offset 0) (endianess :little-endian) (type :signed))
  (let ((value
         (ecase endianess
           (:big-endian
              (+ (ash (aref ub8-array offset) 24)
                 (ash (aref ub8-array (+ 1 offset)) 16)
                 (ash (aref ub8-array (+ 2 offset)) 8)
                 (aref ub8-array (+ 3 offset))))
           (:little-endian
              (+ (aref ub8-array offset)
                 (ash (aref ub8-array (+ 1 offset)) 8)
                 (ash (aref ub8-array (+ 2 offset)) 16)
                 (ash (aref ub8-array (+ 3 offset)) 24))))))
    (if (and (eq :signed type) (logbitp 31 value))
      (lognot (logxor value #xFFFFFFFF))
      value)))
(Continue reading)

Stelian Ionescu | 3 Jun 09:48 2008
Picon

Re: series related error on loading iolib (openmcl 64bit)

On Tue, Jun 03, 2008 at 12:01:14AM +0300, Marko Tapio Manninen wrote:
>Hi,
>
>i got this error, when trying to load iolib:
>
>No MAKE-LOAD-FORM method is defined for #<CCL::SIMPLE-PROGRAM-ERROR 
>#x3000413AE9BD>
>   [Condition of type SIMPLE-ERROR]

I think that this is an OpenMCL bug since I've tested iolib on a few versions
of OpenMCL - on PPC and Intel/64 and it compiled series fine.

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
On Tue, Jun 03, 2008 at 12:01:14AM +0300, Marko Tapio Manninen wrote:
>Hi,
>
>i got this error, when trying to load iolib:
>
>No MAKE-LOAD-FORM method is defined for #<CCL::SIMPLE-PROGRAM-ERROR 
>#x3000413AE9BD>
>   [Condition of type SIMPLE-ERROR]

I think that this is an OpenMCL bug since I've tested iolib on a few versions
of OpenMCL - on PPC and Intel/64 and it compiled series fine.

--

-- 
(Continue reading)

elliott | 3 Jun 15:02 2008
Picon

Re: receiving signed integers

Stelian Ionescu wrote:
> I'm afraid that you'll have to do manual conversion for the moment until
> I'll add the proper routines to write into arrays other than
> '(unsigned-byte 8). Here's a piece of code that can do just that,
> albeit slowly...
>
>   
Cool.  Thanks for the code snippet as well.
elliott
Marko Tapio Manninen | 4 Jun 07:49 2008
Picon

Fwd: series related error on loading iolib (openmcl 64bit)

You were right. It was a bug, but also i had to change series s- 
package.lisp #+mcl to #+ccl.

Thanks,
-Marko

>
> On Tue, Jun 03, 2008 at 12:01:14AM +0300, Marko Tapio Manninen wrote:
>> Hi,
>>
>> i got this error, when trying to load iolib:
>>
>> No MAKE-LOAD-FORM method is defined for #<CCL::SIMPLE-PROGRAM-ERROR
>> #x3000413AE9BD>
>>  [Condition of type SIMPLE-ERROR]
>
> I think that this is an OpenMCL bug since I've tested iolib on a few  
> versions
> of OpenMCL - on PPC and Intel/64 and it compiled series fine.
>
> -- 
> Stelian Ionescu a.k.a. fe[nl]ix
> Quidquid latine dictum sit, altum videtur.

Marko Tapio Manninen | 4 Jun 09:58 2008
Picon

UTF-8 CRLF and UTF-8 CR tests fails

When i run asdf:test-op for iolib, i got several tests failed, but  
they share common things:

;; Test "unicode_demo_utf-8_cr.txt" UTF-8 CR [INPUT] --> UTF-8 CRLF  
[OUTPUT].
;; Test "unicode_demo_utf-8_cr.txt" UTF-8 CR [INPUT] --> UTF-8 CR  
[OUTPUT].

so every test where there is UTF-8 CRLF [OUTPUT] or UTF-8 CR [OUTPUT]  
fails.

Im using openmcl 64bit on macbook.

Id also like to see tutorial for making simple socket server and  
client for sending messages and triggering events with iolib. If  
someone could direct, id appreciate that.

-Marko
Stelian Ionescu | 4 Jun 10:19 2008
Picon

Re: UTF-8 CRLF and UTF-8 CR tests fails

On Wed, Jun 04, 2008 at 10:58:20AM +0300, Marko Tapio Manninen wrote:
>When i run asdf:test-op for iolib, i got several tests failed, but 
>they share common things:
>
>;; Test "unicode_demo_utf-8_cr.txt" UTF-8 CR [INPUT] --> UTF-8 CRLF 
>[OUTPUT].
>;; Test "unicode_demo_utf-8_cr.txt" UTF-8 CR [INPUT] --> UTF-8 CR 
>[OUTPUT].
>
>so every test where there is UTF-8 CRLF [OUTPUT] or UTF-8 CR [OUTPUT] 
>fails.
>
>Im using openmcl 64bit on macbook.

that might be related to babel, please try to run babel's test suite

>Id also like to see tutorial for making simple socket server and 
>client for sending messages and triggering events with iolib. If 
>someone could direct, id appreciate that.

there's an example here: http://common-lisp.net/~sionescu/misc/echo-server.lisp

--

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
On Wed, Jun 04, 2008 at 10:58:20AM +0300, Marko Tapio Manninen wrote:
>When i run asdf:test-op for iolib, i got several tests failed, but 
>they share common things:
(Continue reading)

Marko Tapio Manninen | 4 Jun 14:01 2008
Picon

Re: UTF-8 CRLF and UTF-8 CR tests fails

Babel test suite gives this:

Unknown character name - "udcf0" .
    [Condition of type SIMPLE-ERROR]

 From sources there is two places where it is used:

(deftest utf-8b.1
     (string-to-octets (coerce #(#\a #\b #\udcf0) 'unicode-string)
                       :encoding :utf-8b)

My OS is 10.5.3

Stelian Ionescu kirjoitti 4.6.2008 kello 11.19:

> On Wed, Jun 04, 2008 at 10:58:20AM +0300, Marko Tapio Manninen wrote:
>> When i run asdf:test-op for iolib, i got several tests failed, but
>> they share common things:
>>
>> ;; Test "unicode_demo_utf-8_cr.txt" UTF-8 CR [INPUT] --> UTF-8 CRLF
>> [OUTPUT].
>> ;; Test "unicode_demo_utf-8_cr.txt" UTF-8 CR [INPUT] --> UTF-8 CR
>> [OUTPUT].
>>
>> so every test where there is UTF-8 CRLF [OUTPUT] or UTF-8 CR [OUTPUT]
>> fails.
>>
>> Im using openmcl 64bit on macbook.
>
> that might be related to babel, please try to run babel's test suite
(Continue reading)

Marko Tapio Manninen | 6 Jun 07:35 2008
Picon

traceback help

Hi,

every now and then i get the mysterious traceback with emacs and slime  
and i cant always figure out, how to detect the problem. In this case  
anonymous function is called with invalid arguments, but how do i  
know, what is the specific function, where it is and so on? This error  
comes, when using iolib tutorial socket server and while it talk about  
ccl threads, i thought if you could help with it:

Invalid program: Too many arguments in call to #<Anonymous Function  
#x30004108C64F>:
1 arguments provided, at most 0 accepted.
    [Condition of type CCL::SIMPLE-PROGRAM-ERROR]

Backtrace:
   0: (IO.MULTIPLEX::MIN-TIMEOUT 6397.371749698D0 6402.371506881D0 1)
       Locals:
         IO.MULTIPLEX::TIMEOUTS = (6397.371749698D0 6402.371506881D0 1)
   1: (#<STANDARD-METHOD IO.MULTIPLEX:EVENT-DISPATCH  
(IO.MULTIPLEX:EVENT-BASE)> #<event base, 1 FDs monitored, using:  
#<kqueue(2) multiplexer> #x3000415EC40D> ':ONE-SHOT 'NIL ':TIMEOUT 10  
':MAX-TIMEOUT 1)
       Locals:
         IO.MULTIPLEX::ONE-SHOT = NIL
         IO.MULTIPLEX::TIMEOUT = 10
         IO.MULTIPLEX::MAX-TIMEOUT = 1
         IO.MULTIPLEX::GOT-FD-EVENTS-P = NIL
         IO.MULTIPLEX::GOT-FD-TIMEOUTS-P = NIL
         IO.MULTIPLEX::GOT-TIMERS-P = NIL
   2: (CCL::%CALL-NEXT-METHOD '(NIL
(Continue reading)


Gmane