this ...
| (defun e-guid-list->property-records (lang p-guid-list)
| (loop for e
| in (mapcar #'(lambda (p) (product-element
| (find-element p lang)))
| p-guid-list)
| when e
| nconc (product-property e)))
... works only once. The second time it is sent into infinity.
The called functions are well tested and work on their own.
Any ideas?
Further information required?
Thanks
Jens
sorry to answer twice on my own post
I mixed German and English names. In the first post I tried to translate my
German symbol-names into English. The second post contains German symbol-names.
Don't care about differences
produkt product
merkmal property
...
Jens
On Wed, 01 Aug 2007 11:04:59 +0200, Jens Teich <····@jensteich.de> wrote:
> this ...
>
> | (defun e-guid-list->property-records (lang p-guid-list)
> | (loop for e
> | in (mapcar #'(lambda (p) (product-element
> | (find-element p lang)))
> | p-guid-list)
> | when e
> | nconc (product-property e)))
>
> ... works only once.
Try if the problems go away if you replace NCONC with APPEND.
Edi.
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
P� Wed, 01 Aug 2007 11:04:59 +0200, skrev Jens Teich <····@jensteich.de>:
>
> this ...
>
> | (defun e-guid-list->property-records (lang p-guid-list)
> | (loop for e
> | in (mapcar #'(lambda (p) (product-element
> | (find-element p lang)))
> | p-guid-list)
> | when e
> | nconc (product-property e)))
>
I would try
(loop for e in ...
when e collect (product-property (copy-seq e)) as result
finally (nreverse result))
The push, nreverse idiom is faster and not doing in-place operations
avoids side-effects.
Also the (copy-seq e) is there to avoid side effects.
P� Wed, 01 Aug 2007 14:06:47 +0200, skrev John Thingstad
<··············@chello.no>:
> P� Wed, 01 Aug 2007 11:04:59 +0200, skrev Jens Teich <····@jensteich.de>:
>
>>
>> this ...
>>
>> | (defun e-guid-list->property-records (lang p-guid-list)
>> | (loop for e
>> | in (mapcar #'(lambda (p) (product-element
>> | (find-element p lang)))
>> | p-guid-list)
>> | when e
>> | nconc (product-property e)))
>>
>
> I would try
>
> (loop for e in ...
> when e collect (product-property (copy-seq e)) as result
> finally (nreverse result))
>
> The push, nreverse idiom is faster and not doing in-place operations
> avoids side-effects.
> Also the (copy-seq e) is there to avoid side effects.
Arg! forget that.. Brain fart.
More like this.
(mapcan (lambda (e) (when e (product-property e)) (mapcar (lambda (p)
(product-element p lang)) p-guid-list))
"John Thingstad" <··············@chello.no> writes:
> P� Wed, 01 Aug 2007 14:06:47 +0200, skrev John Thingstad
> <··············@chello.no>:
>
>> P� Wed, 01 Aug 2007 11:04:59 +0200, skrev Jens Teich <····@jensteich.de>:
>>
>>>
>>> this ...
>>>
>>> | (defun e-guid-list->property-records (lang p-guid-list)
>>> | (loop for e
>>> | in (mapcar #'(lambda (p) (product-element
>>> | (find-element p lang)))
>>> | p-guid-list)
>>> | when e
>>> | nconc (product-property e)))
>>>
>>
>> I would try
>>
>> (loop for e in ...
>> when e collect (product-property (copy-seq e)) as result
>> finally (nreverse result))
>>
>> The push, nreverse idiom is faster and not doing in-place operations
>> avoids side-effects.
>> Also the (copy-seq e) is there to avoid side effects.
>
> Arg! forget that.. Brain fart.
> More like this.
>
> (mapcan (lambda (e) (when e (product-property e)) (mapcar (lambda (p)
> (product-element p lang)) p-guid-list))
Thanks for this suggestion. Looks as if something behind the scenes is
happening. Unicode data is part of the problem and I get an error
| SB-INT:STREAM-ENCODING-ERROR
which kills the slime session and is only visible in the sbcl (via screen).
sbcl runs stable.
Jens