another stream oddity

0 views
Skip to first unread message

leh...@bayou.uni-linz.ac.at

unread,
Dec 21, 2009, 11:45:40 AM12/21/09
to fricas...@googlegroups.com
Hello,

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

Johannes Grabmeier

unread,
Dec 21, 2009, 12:44:16 PM12/21/09
to fricas...@googlegroups.com

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

leh...@bayou.uni-linz.ac.at

unread,
Dec 21, 2009, 1:10:38 PM12/21/09
to fricas...@googlegroups.com
On Mon, Dec 21, 2009 at 06:44:16PM +0100, Johannes Grabmeier wrote:
> 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)?
This is meant to be a minimal example showing the problem.
The problem occured in a more meaningful context,
where such a construction is actually needed.

regards,
Franz

Ralf Hemmecke

unread,
Dec 22, 2009, 6:49:22 AM12/22/09
to fricas...@googlegroups.com
What about making the more complicated code visible? Then it would be
easier to help you find a workaround for your real problem.

Ralf

leh...@bayou.uni-linz.ac.at

unread,
Dec 22, 2009, 7:58:48 AM12/22/09
to fricas...@googlegroups.com
On Tue, Dec 22, 2009 at 12:49:22PM +0100, Ralf Hemmecke wrote:
> What about making the more complicated code visible? Then it would be
> easier to help you find a workaround for your real problem.
The original line occured in the interpreter:

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

Ralf Hemmecke

unread,
Dec 22, 2009, 8:11:59 AM12/22/09
to fricas...@googlegroups.com
> Aedim:= [reduce(+,[nullity matrix adjacencyMatrix subgraph(A,CF) for A in ak]) for ak in animals(e,CF)]

Sorry, I cannot reproduce/execute that.

Maybe you put the complete code on Mathaction or GitHub? (GitHub preferred)

Ralf

leh...@bayou.uni-linz.ac.at

unread,
Dec 23, 2009, 6:12:56 AM12/23/09
to fricas...@googlegroups.com
On Tue, Dec 22, 2009 at 02:11:59PM +0100, Ralf Hemmecke wrote:
> Maybe you put the complete code on Mathaction or GitHub? (GitHub preferred)
Well the file is in a messy state (half translated from aldor)
and I have no time to sort it out this year.
There are more urgent things in the queue.
Anyways it is not relevant for the reported bug.

regards,
Franz

Reply all
Reply to author
Forward
0 new messages