<br><br>
<div class="gmail_quote">On Fri, Oct 29, 2010 at 12:43 PM, Alexandre BP <span dir="ltr">&lt;<a href="mailto:abalonpe@ulb.ac.be">abalonpe@ulb.ac.be</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div>thank you for your reply</div>I have a class named &quot;PaperBibli&quot; which keeps a list of bibliographic entries. 
<div>Those entries are of different type: Article, Book, Conference,...</div>
<div>Every type has its own fields such as: author,title,...</div>
<div><br></div>
<div> --&gt; I created SubClasses of &quot;PaperBibli&quot; for each type so that when I instanciate an bibliographic entry I don&#39;t have lots of variables(fields) which are empty because not required in a particular type.</div>

<div>The problem is that when I instanciate my bibliographic entry I still don&#39;t know of which type it is because the user tell me so by choosing in a scroll list.</div>
<div><br></div>
<div>I hope that my explanation is clear</div></div></blockquote>
<div> </div>
<div>Now its clear. Your scroll list, in Seaside, can hold the subClasses of Bibli as its list items (but can render labels: for each class). Then in the scroll list&#39;s callback: the value handed to it will be the selected subclass (NOT the label), so that you WILL know which class to create.</div>

<div>Cool huh?</div>
<div> </div>
<div>html select</div>
<div>   list: PaperBibli allSubclasses;</div>
<div>   labels: [ :val | val class ];  &lt;-- &quot;implement a label message in each class to return a nice string then the block would be [ :val | val label ]&quot;</div>
<div>   callback: [ :cls | someVar := cls new ];  &lt;---cls is one of the subclasses!</div>
<div>  .....&amp;etc</div>
<div> </div>
<div>Hope that helps</div>
<div>John</div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div><br></div>
<div><br></div>
<div><br><br>
<hr>
Date: Fri, 29 Oct 2010 12:24:22 -0400<br>Subject: Re: [Seaside] Dynamic typing in smalltalk<br>From: <a href="mailto:sean@monkeysnatchbanana.com" target="_blank">sean@monkeysnatchbanana.com</a><br>To: <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a> 
<div>
<div></div>
<div class="h5"><br><br>There are types in smalltalk. Each object has a type. 
<div><br></div>
<div>That aside, what are you trying to accomplish with your example below?</div>
<div><br></div>
<div>
<div>
<div><br>
<div>On Fri, Oct 29, 2010 at 12:13 PM, Alexandre BP <span dir="ltr">&lt;<a href="mailto:abalonpe@ulb.ac.be" target="_blank">abalonpe@ulb.ac.be</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; PADDING-LEFT: 1ex">
<div><br>Hello, 
<div><br></div>
<div>I would like to know if it is possible to apply dynamic typing in smalltalk. For example, If I want to use polymorphism, it would be:</div>
<div><span style="WHITE-SPACE: pre-wrap"></span></div>
<div><span style="WHITE-SPACE: pre-wrap"></span>     var := Class new.</div>
<div><span style="WHITE-SPACE: pre-wrap"></span>var := (SubClass1) message. </div>
<div><span style="WHITE-SPACE: pre-wrap"></span>var := (SubClass2) message.</div>
<div><br></div>
<div>Where message from SubClass1 is different then the one from SubClass2.</div>
<div>Is there any solution for my problem? </div>
<div>I know that there is no type in smalltalk but there is definitely a way to use polymorphism right?</div>
<div><br></div>
<div>Thank you in advance,</div>
<div>Regards</div>
<div>alex</div></div><br>_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br></div></div></div><br></div></div>_______________________________________________ seaside mailing list <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a></div>
</div><br>_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://john-mckeon.us/" target="_blank">http://john-mckeon.us</a><br>