<html><head><base href="x-msg://6/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">It doesn't matter. You don't need to know the type. You need to know what to ask.&nbsp;<div><br></div><div>For example its description (or label or whatever).&nbsp;So, you get a bunch of PaperBibli (and siblings) and you know they all answer correctly to, say, the #describe method. Then you use it (to render it or whatever).<div><br></div><div>That means you need to implement the #describe (or #description, or #name) method in every one of the subclasses (or factor it in its superclass)</div><div><br></div><div><a href="http://twitter.sebastianconcept.com">sebastian</a></div><div>&nbsp;<br><div><br></div><div><br><div><div>On Oct 29, 2010, at 2:43 PM, Alexandre BP wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><div>thank you for your reply</div>I have a class named "PaperBibli" 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>&nbsp;--&gt;&nbsp;I created SubClasses of "PaperBibli" for each type so that when I instanciate an bibliographic entry I don'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'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><br></div><div><br></div><div><br><br><hr id="stopSpelling">Date: Fri, 29 Oct 2010 12:24:22 -0400<br>Subject: Re: [Seaside] Dynamic typing in smalltalk<br>From:<span class="Apple-converted-space">&nbsp;</span><a href="mailto:sean@monkeysnatchbanana.com">sean@monkeysnatchbanana.com</a><br>To:<span class="Apple-converted-space">&nbsp;</span><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br><br>There are types in smalltalk.&nbsp;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 class="ecxgmail_quote">On Fri, Oct 29, 2010 at 12:13 PM, Alexandre BP<span class="Apple-converted-space">&nbsp;</span><span dir="ltr">&lt;<a href="mailto:abalonpe@ulb.ac.be">abalonpe@ulb.ac.be</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br><blockquote class="ecxgmail_quote" style="border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: 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>&nbsp;&nbsp; &nbsp; var := Class new.</div><div><span style="white-space: pre-wrap; ">        </span>var := (SubClass1) message.&nbsp;</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?&nbsp;</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">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>_______________________________________________ seaside mailing list<span class="Apple-converted-space">&nbsp;</span><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a></div>_______________________________________________<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">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br></div></blockquote></div><br></div></div></div></body></html>