Re: box? on address

2017-02-10 Thread Joh-Tob Schäg
Hi Regenaxer,

I realize that there is no probkem with the evaluation of 'circ?.
Could 'later be (miss)used to cause some havick when it writes back data?
What about timer triggered code?
Am 10.02.2017 22:40 schrieb "Alexander Burger" :

> Hi Joh-Tob,
>
> > Doesn't 'circ? also set the gc bit?
>
> Well observed!! That't true, but it is the "other" mark bit. While gc uses
> the
> bit in the CDR
>
>or (X CDR) 1  # Set mark bit
>
> uses 'circ' the one in the CAR of the cell
>
>or (A) 1  # Mark
>
>
> > Could it be possible that 'circ? evaluates a term which accesses
> something
> > with a changed pointer?
>
> The bits are only set after all evaluation is done, and the raw circ
> detection
> processing runs. Then the bits are cleared (as after garbage collection
> too).
>
> ♪♫ Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: box? on address

2017-02-10 Thread Alexander Burger
Hi Joh-Tob,

> Doesn't 'circ? also set the gc bit?

Well observed!! That't true, but it is the "other" mark bit. While gc uses the
bit in the CDR

   or (X CDR) 1  # Set mark bit

uses 'circ' the one in the CAR of the cell

   or (A) 1  # Mark


> Could it be possible that 'circ? evaluates a term which accesses something
> with a changed pointer?

The bits are only set after all evaluation is done, and the raw circ detection
processing runs. Then the bits are cleared (as after garbage collection too).

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: box? on address

2017-02-10 Thread Joh-Tob Schäg
Doesn't 'circ? also set the gc bit?
Could it be possible that 'circ? evaluates a term which accesses something
with a changed pointer?
Am 10.02.2017 18:12 schrieb "Alexander Burger" :

> H Danilo,
>
> > Please take a quick look at [path "@doc64/structures"] and
> > source code of `car' and `val'.
> >
> > I am not sure what will happen if GC bit is 1.
>
> This is a good question. The interpreter would crash with a bus error.
> Fortunately this won't happen because this bit is guaranteed to be set only
> while GC runs.
>
> ♪♫ Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: box? on address

2017-02-10 Thread Alexander Burger
H Danilo,

> Please take a quick look at [path "@doc64/structures"] and
> source code of `car' and `val'.
> 
> I am not sure what will happen if GC bit is 1.

This is a good question. The interpreter would crash with a bus error.
Fortunately this won't happen because this bit is guaranteed to be set only
while GC runs.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: box? on address

2017-02-10 Thread pd
Hi Danilo


Isn't [doc 'car] clear enough?
>

clear as an unmuddied lake ;-)   doc should be read because reading it
makes guessing innecesary ;-)


>
> Please take a quick look at [path "@doc64/structures"] and
> source code of `car' and `val'.
>
> I am not sure what will happen if GC bit is 1.
>

I'll do, very interesting documentet!


Re: box? on address

2017-02-10 Thread Danilo Kordic
A few more examples:

: [setq S1 "A"]
-> "A"
: (box? S1)
-> NIL
: (name S1 "")
-> "NIL"  # ?!
: S1
-> "NIL"
: (name NIL)
-> NIL  # ?!
: (name 'S1)
-> "S1"

: [setq B1 [box 'val]]
-> $177002116445201
: (val B1)
-> val
: (name B1)
-> NIL
: (name S1 B1)
-> $177002116444132
: (name S1)
-> NIL
: (box? S1)
-> $177002116444132


Hi pd.

Isn't [doc 'car] clear enough?

Please take a quick look at [path "@doc64/structures"] and
source code of `car' and `val'.

I am not sure what will happen if GC bit is 1.
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: box? on address

2017-02-09 Thread pd
On Thu, Feb 9, 2017 at 6:13 PM, Christopher Howard  wrote:

> Hi, I was just trying to understand...
>
> : (box? (box (4 5 6)))
> -> $384375304
> : (box? $384375304)
> -> NIL
> : (car $384375304)
> -> 4
>
> Shouldn't (box? $384375304) be non-NIL?
>

As Danilo said box? evaluates its arguments and that's the reason to return
NIL because a list is not an anonymous symbol

The same happens with the call to car, car evaluates its arguments so you
get the car of the list

To allow box? to deal with anonymous symbol you must quote it

If you type the $-number representing the anonymous symbol in the pil
prompt you see its value, in your case:

: $384375304
-> (4 5 6)

The result of evaluating the anonymous symbols and that explains the
behaviour of your calls to both box? and car,

: (car $384375304)# = (car (4 5 6))
-> 4

but what if you call car with real anonymous symbol (quoting it to prevent
evaluation)?

: (car '$384375304)
-> (4 5 6)

why? my guess is anonymous symbols store its value in the car of its cell


Re: box? on address

2017-02-09 Thread Mike Pechkin
hi,

Lets talk about
​​t
ransient
​s​
ymbols
​ from this two links:
http://software-lab.de/doc/ref.html#transient
http://pastebin.com/AsuveCFY

​

On Thu, Feb 9, 2017 at 7:13 PM, Christopher Howard  wrote:

> Hi, I was just trying to understand...
>
> : (box? (box (4 5 6)))
> -> $384375304
> : (box? $384375304)
> -> NIL
> : (car $384375304)
> -> 4
>
> Shouldn't (box? $384375304) be non-NIL?
>
> --
> Christopher Howard, Computer Assistant
> Alaska Satellite Internet
> 3239 La Ree Way, Fairbanks, AK 99709
> 907-451-0088 or 888-396-5623 (toll free)
> fax: 888-260-3584
> mailto:christop...@alaskasi.com
> http://www.alaskasatelliteinternet.com
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: box? on address

2017-02-09 Thread Danilo Kordic
`box?' evaluates it's argument.  In this case it is `lst' ``(4 5 6)''.

BTW I didn't know `print'ed box can be `read' back.
For example ``$0'' does have a name, but `print'ed one does not.
It makes no sense to me.


On 2/9/17, Christopher Howard  wrote:
> Hi, I was just trying to understand...
>
> : (box? (box (4 5 6)))
> -> $384375304
> : (box? $384375304)
> -> NIL
> : (car $384375304)
> -> 4
>
> Shouldn't (box? $384375304) be non-NIL?
>
> --
> Christopher Howard, Computer Assistant
> Alaska Satellite Internet
> 3239 La Ree Way, Fairbanks, AK 99709
> 907-451-0088 or 888-396-5623 (toll free)
> fax: 888-260-3584
> mailto:christop...@alaskasi.com
> http://www.alaskasatelliteinternet.com
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


box? on address

2017-02-09 Thread Christopher Howard
Hi, I was just trying to understand...

: (box? (box (4 5 6)))
-> $384375304
: (box? $384375304)
-> NIL
: (car $384375304)
-> 4

Shouldn't (box? $384375304) be non-NIL?

-- 
Christopher Howard, Computer Assistant
Alaska Satellite Internet
3239 La Ree Way, Fairbanks, AK 99709
907-451-0088 or 888-396-5623 (toll free)
fax: 888-260-3584
mailto:christop...@alaskasi.com
http://www.alaskasatelliteinternet.com
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe