'share

Q&A's, tips, howto's
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

'share

Post by newdep »

Hi Lutz,

Is this behaviour or a mismatch ? See below ->


> (set 'mem (share))
1073836032

> (string '(hello))
"(hello)"

> (share mem (string '(hello)))

number or string expected : "(hello)"

>


Norman.
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Works fine on FreeBSD and Sun Solaris, cannot test on Linux until tomorrow, Saturday.

Code: Select all

~> newlisp
newLISP v.8.2.1 Copyright (c) 2004 Lutz Mueller. All rights reserved.

> (set 'mem (share))
672792576
> (share mem "(hello)")
"(hello)"
> (share mem (string '(hello)))
"(hello)"
>
How to numbers work? And can you run examples/prodcons.lsp ? you run it with a parameter i.e.:

./prodcons.lsp 100

You are running Linux right?

Lutz

ps: also works without doing (share mem "(hello)") first

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

HI lutz...

Im running slackware 9.0 and 10.0..

On the 9.0 ->

bash-2.05b$ ./prodcons.lsp 100
-> 1
1 <-
-> 2
2 <-
-> 3
3 <-
-> 4
4 <-
-> 5
5 <-
-> 6
6 <-
-> 7
7 <-
-> 8
8 <-
-> 9
9 <-
-> 10
10 <-
bash-2.05b$ newlisp
newLISP v.8.2.1 Copyright (c) 2004 Lutz Mueller. All rights reserved.

> (set 'mem (share))
1073831936

> (share mem (string '(hello)))

number or string expected : "(hello)"

> (sys-info)
(338 268435456 281 1 0 1024 8201 1)
>


on the 10.0 ->

Exactly the same, BUT the error message is intresting ->

number or string expected : "(\"hello\")"

see the extra... \"


Norman.
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

After recompiling the released 8.2.1 it turned out that 'share' of strings was broken in all versions. This was a release problem posting a previous to the final 8.2.1.

A 8.2.2 fixing this will be released shortly.

Lutz

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Up and running !

Thanks :-)
-- (define? (Cornflakes))

Locked