#asCondition

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

#asCondition

Damien Cassou-3
Hi,

I don't understand why the following code returns 'false':

[:aPerson |
   (aPerson description
        collect: [:desc | (desc toString: (aPerson readUsing: desc))])
    anySatisfy: [:value | value matches: 'France']] asCondition


Is it because my code is not understood by the parser ?

--
Damien Cassou

CSS3 :  "On passe au  HSL, plus intuitif  et moins orienté CRT  que le
RGB. Il y a du HSLA". Et en plus, ça veut dire quelque chose (au moins
pour l'auteur) !

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: #asCondition

Lukas Renggli-2
> I don't understand why the following code returns 'false':
>
> [:aPerson |
>    (aPerson description
>         collect: [:desc | (desc toString: (aPerson readUsing: desc))])
>     anySatisfy: [:value | value matches: 'France']] asCondition
>
> Is it because my code is not understood by the parser ?

Yes, it uses blocks.

Try as condition:

[ :person | person isFrance ]
      asCondition.

And as implementation:

Person>>isFrance
     (self description
         collect: [ :desc | (desc toString: (self readUsing: desc)) ])
         anySatisfy: [ :value | value matches: 'France' ].

You can easily check if everything is ok with your conditions, if you  
explore them:

[ :person | person isFrance ]
     asConditon explore

If you don't want to store your descriptions externally  
(ReferenceStreams, Magma, OmniBase, ...) you can also use plain  
blocks, that is maybe easier most of the time.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: #asCondition

Damien Cassou-3
> If you don't want to store your descriptions externally  
> (ReferenceStreams, Magma, OmniBase, ...) you can also use plain  
> blocks, that is maybe easier most of the time.

When does one would want to store his descriptions ?

--
Damien Cassou

CSS3 :  "On passe au  HSL, plus intuitif  et moins orienté CRT  que le
RGB. Il y a du HSLA". Et en plus, ça veut dire quelque chose (au moins
pour l'auteur) !

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: #asCondition

Lukas Renggli-2
>> If you don't want to store your descriptions externally
>> (ReferenceStreams, Magma, OmniBase, ...) you can also use plain
>> blocks, that is maybe easier most of the time.
>
> When does one would want to store his descriptions ?

If you let your end-users build their own forms.

We once wrote a workflow definition and runtime engine at nestyle.ch  
using Magritte, where the users could build their own forms and  
define validation conditions on the form elements, all  from the web-
browser without programming knowledge. The meta-model is then stored  
in OmniBase. That's way I payed so much attention to make everything  
serialize-able. That being possible is one of the key advantages of  
Magritte over other meta frameworks, e.g., Mewa expects a lot of  
blocks everywhere.

As I said previously, you are not forced to worry about theses  
things, it is more of a technical than a design question: since I  
this is Smalltalk you can exchange conditions and use block-closures  
polymorphic. Each of the approaches has its own (dis-)advantages.

Lukas

>
> --
> Damien Cassou
>
> CSS3 :  "On passe au  HSL, plus intuitif  et moins orienté CRT  que le
> RGB. Il y a du HSLA". Et en plus, ça veut dire quelque chose (au moins
> pour l'auteur) !
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

--
Lukas Renggli
http://www.lukas-renggli.ch




_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Production Ready SmallWiki[n]?

Brett R. Taylor
In reply to this post by Damien Cassou-3
Is there a version of Smallwiki that is ready for production?  If not,
can anyone recommend a stable Smalltalk based wiki?
Brett

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Production Ready SmallWiki[n]?

Lukas Renggli-2
> Is there a version of Smallwiki that is ready for production?  If not,
> can anyone recommend a stable Smalltalk based wiki?

That depends on what Smalltalk you want to run SmallWiki on: Squeak  
or VisualWorks?

The wikis I know of are listed at <http://smallwiki.unibe.ch>, please  
add your instances if you know more:

http://www.squeak.org
http://www.seaside.st
http://www.esug.org
http://kilana.unibe.ch/lmo2005/
http://www.squeak.de/
http://www.wiresong.ca/Monticello/
http://www.hans-n-beck.org/
http://prog2.vub.ac.be:8080/esug2005/
http://box1.squeakfoundation.org:7777/
http://www.kita-st-anna.de/
http://www.tierpark-koethen.de/
http://decomp.ulb.ac.be/
http://decomp.ulb.ac.be/roelwuyts/
http://restructuring.ulb.ac.be/
http://tweak.impara.de/

Please note that I am not working on SmallWiki anymore, however there  
are a couple of other people working on it, so they might know better  
what version to use the best.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki