noted the sort-method is callbacked from native code?
someone might have a two-argument-call hardwired?
and /local is technically a refinement:
>> a: func[/local b][2 * b]  a/local 5
== 10
might be not checked in the c-code?

workaround:
sort-method: func [a b /local c] [c: a/type < b/type c]
sort/compare database func[a b][sort-method a b]
or that.

> I just want to clear the table after the sort-method's dinner. I don't like lea
> ving the remains on the table.
AFAIK the last local vars are keeped referenced?
>> a: func[/local b][b: 5 * 2] a  reduce[ first second :a   get first second :a]
== [b: 10]

Volker

> [EMAIL PROTECTED] wrote:
> 
> > The series to sort is a block of 59 objects (for now), sorted with something 
> like this (which also aborts):
> > 
> > sort-method: func [a b /local c] [c: a/type < b/type c]
> > sort/compare database :sort-method
> > 
> > Is this a bug or just me missing something totally obvious? Garbage collectio
> n? Garbage in my mind?
> 
> It surely smells like a bug, but I don't know if it is related to
> the known GC bugs; it looks like the GC is freeing the function's
> context or some of the value it stores, but this is known to
> happen with unreferenced contexts (like the ones created with
> USE), and not with referenced contexts (from functions, objects
> etc.).
> 
> So maybe the bug has to do with SORT too...
> 
> Could you try your code again disabling the GC (with RECYCLE/OFF)?
> 
> Regards,
>    Gabriele.
> -- 
> Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer
> Amiga Group Italia sez. L'Aquila --- http://www.amyresource.it/AGI
> 
> 
> 

Reply via email to