On 09/10/2015 03:08 PM, Waldek Hebisch wrote: >> Table(Key : SetCategory, Entry : Type) : Exports == Implementation where > > Do you compile the whole domain? IIRC during build of Aldor interface > you just compile interface (category) stuff and implementation does > not matter. The line aboove is in implementation part while > GEM appeared in exported signature.
Ah, yes. You are right. It's only the interface that matters. > There is an obscure Spad syntax intended for such situation: > > for i in v for restl in tails(rest(v)) repeat > > should work here. The 'restl in tails(rest(v))' part assigns successive > tails of 'rest(v)' to 'restl'. I wondered why you called that "obscure". In Aldor, tails is an ordinary library function. https://github.com/pippijn/aldor/blob/master/aldor/lib/axllib/src/al/list.as#L267 tails(l: %): Generator % == generate { while l repeat { -- Save the tail first to allow clients to update it. tl := rest l; yield l; l := tl; } } Since SPAD does not yet have Generator, we could have (in list.spad) a function tails: % -> List L with the respective semantics. > AFAICS this construct is currently unused in algebra and does not > work in the interpreter. I think we should either use it or > remove it. I'd be in favour of removing it and if it is ever needed introduce it again via some library function. >> As for the variable 'semi'. It is only important if 'option="semireg". >> Feels to me like you are wasting time computing 'semi' it if this option >> is not set. > > Main effort goes into 'unsafe' which is needed. I don't understand. I was complaining about Table and 'semi' and its linear time access. Now it's done via an array. That's better, but still a slight overhead if the option is not "semireg". Ralf -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.
