>An alternative to while is to do a recursive loop similar to functional 
programming

I have successfully defined a ui:Operations subclass that recurses based on 
count and maximum count Arguments defined in SPIN constraints. The 
ui:Operations subclass is called from the ui:prototype of a ui:Services 
subclass.

Are there examples of:
1. returning a value from a ui:Operations subclass
2. assigning a variable the value of the result of a ui:Operations subclass
3. updating an Argument in Pass By Reference style


On Tuesday, August 6, 2019 at 7:56:30 PM UTC-4, Holger Knublauch wrote:
>
> All queries in SWP, such as the result set of a ui:forEach, are computed 
> at once, i.e. there is no way to dynamically change the loop based on 
> things happening inside of the loop. There is no ui:while either - I guess 
> we just never had use cases for that. An alternative to while is to do a 
> recursive loop similar to functional programming, e.g. define ui:MyElement 
> which has a prototype with a ui:if... and then calling <ui:MyElement /> 
> again until the if is false. This approach however can run into stack 
> overflows, i.e. only works for certain traversal depths.
>
> Holger
>
>
> On 7/08/2019 02:17, Jack Hodges wrote:
>
> I would like to perform a while or do-while iteration with SWP. That is, 
> condition based rather than item based as in ui:foreach. I see nothing in 
> the manual about it so I'll look in the libraries but thought I ask in 
> parallel. I do not know if a ui:if and a ui:foreach can produce the same 
> results. Any pointers to examples or documentation appreciated. 
>
> Jack
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/849cd590-7cfa-4068-b93f-9516ab7c2fcf%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/849cd590-7cfa-4068-b93f-9516ab7c2fcf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/3aa68a76-45d7-41e6-abb4-3b7b95c680fa%40googlegroups.com.

Reply via email to