nested looping in streams is not working for me
(rev 754 on sbcl 1.0.18 debian lenny amd64):
*************************************************************************
(1) -> aa:=repeating [[1,1]]
_____
(1) [[1,1]]
Type: Stream(List(PositiveInteger))
(2) -> [reduce(+,[x for x in ak]) for ak in aa]
>> System error:
The value (ELT |envArg| 0) is not of type SYMBOL.
(2) -> [reduce(+,[M for M in ak]) for ak in aa]
>> System error:
The variable M is unbound.
(2) -> [reduce(+,[x for x in aa k]) for k in 1..]
>> System error:
The value (ELT |envArg| 0) is not of type SYMBOL.
(2) -> [reduce(+,[x for x in aa k]) for k in 1..5]
(2) [2,2,2,2,2]
Type: List(PositiveInteger)
(3) ->
*************************************************************************
what am I missing here?
regards,
Franz
I am sure the system experts will find the reason for this strange behaviour , your showed us, but let me ask, why do use such a complicated (although to my opinion possible syntax)? See
(1) -> aa := repeating [[1,1]]
_____
(1) [[1,1]]
Type: Stream(List(PositiveInteger))
(2) -> [reduce(+,li) for li in aa]
_
(2) [2]
Type: Stream(PositiveInteger)
> --
>
> You received this message because you are subscribed to the Google Groups
> "FriCAS - computer algebra system" group. To post to this group, send email
> to fricas...@googlegroups.com. To unsubscribe from this group, send
> email to fricas-devel...@googlegroups.com. For more options, visit
> this group at http://groups.google.com/group/fricas-devel?hl=en.
--
Mit freundlichen Grüßen
Johannes Grabmeier
Prof. Dr. Johannes Grabmeier
Köckstr. 1, D-94469-Deggendorf
Tel.-pv. +49-(0)-991-2979-584, Tel.-mob. 0171-550-3789
Tel.-d +49-(0)-991-3615-141, Sekr. -154
Fax-p: +49-(0)-1803-5518-17745
regards,
Franz
Ralf
Aedim:= [reduce(+,[nullity matrix adjacencyMatrix subgraph(A,CF) for A in ak]) for ak in animals(e,CF)]
(Lots of local functions are involved here.
Some time ago I took the skeleton of a Graph domain from the sandbox
page and adapted it to my needs.
CF is the Cayley graph of the free group, e is the unit element,
and animals(e,CF) computes a stream of sets of animals containing e by
brute force. This is important for percolation.)
Probably map can work around the bug, but I didn't bother.
Anyways this computation is finished, I just noticed the bug and
reported it.
regards,
Franz
Sorry, I cannot reproduce/execute that.
Maybe you put the complete code on Mathaction or GitHub? (GitHub preferred)
Ralf
regards,
Franz