<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dpdv sintactic constructia ar fi corecta.<div class=""><div class="">Raluca</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 31, 2015, at 6:38 PM, Cosmin - Ioan PETRI?OR via cpl <<a href="mailto:cpl@cursuri.cs.pub.ro" class="">cpl@cursuri.cs.pub.ro</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="divtagdefaultwrapper" style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class="">Salutare,<br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Ok, dar problema mea este de natura sintactica si nu semantica. Sa inteleg ca si din punct de vedere sintactic o constructie x = 2 + while ... ar fi gresita? As I was saying before, in manual sunt tratate identic cele doua statement-uri, cel putin sintactic vorbind.</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Cosmin<br class=""></div><br class=""><br class=""><div style="" class=""><hr tabindex="-1" style="display: inline-block; width: 988.8125px;" class=""><div id="divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>Raluca Grigoras <<a href="mailto:ralucav@gmail.com" class="">ralucav@gmail.com</a>><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Saturday, October 31, 2015 6:34 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Cosmin - Ioan PETRI?OR; Compilatoare<br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [cpl] [Tema1] Rolul IF / WHILE</font><div class=""> </div></div><div class="">Salut,<div class=""><br class=""></div><div class="">Tipul unei expresii IF este dat de tipul ultimei instructiuni/expresii din cele doua ramuri. Prin urmare o expresie IF poate avea tipul Int. </div><div class="">Tipul unei expresii WHILE este mereu Void, in cazul in care ar aparea intr-o expresie de genul var x = 2 + while …, ar fi o eroare semantica, pentru ca tipul Void nu poate fi convertit la Int.</div><div class=""><br class=""></div><div class="">Raluca</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Oct 31, 2015, at 6:23 PM, Cosmin - Ioan PETRI?OR via cpl <<a href="mailto:cpl@cursuri.cs.pub.ro" class="">cpl@cursuri.cs.pub.ro</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="divtagdefaultwrapper" class="" style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;"><div class="" style="margin-top: 0px; margin-bottom: 0px;">Hello,</div><div class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></div><div class="" style="margin-top: 0px; margin-bottom: 0px;">Am vazut in manual, pag. 11, ca IF si WHILE sunt considerati operatori (mai mult decat atat, de acelasi rang). Fair enough.</div><div class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></div><div class="" style="margin-top: 0px; margin-bottom: 0px;">Problema este ca in teste am observat expresii de genul: var = 2 + if ... then ... else ... end; and I'm ok with that. Dar ce nu am reusit sa deslusesc este daca si WHILE are acelasi statut, pentru ca am vazut doar blocuri WHILE independente.</div><div class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></div><div class="" style="margin-top: 0px; margin-bottom: 0px;">So here comes my question: Putem folosi constructii WHILE in cadrul expresiilor, sau trebuie tratat separat de IF?</div><div class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></div><div class="" style="margin-top: 0px; margin-bottom: 0px;">Numai bine,</div><div class="" style="margin-top: 0px; margin-bottom: 0px;">Cosmin<br class=""></div></div><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; float: none; display: inline !important;">_______________________________________________</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; float: none; display: inline !important;">cpl mailing list</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><a href="mailto:cpl@cursuri.cs.pub.ro" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">cpl@cursuri.cs.pub.ro</a><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/cpl" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/cpl</a></div></blockquote></div><br class=""></div></div></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">cpl mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:cpl@cursuri.cs.pub.ro" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">cpl@cursuri.cs.pub.ro</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/cpl" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/cpl</a></div></blockquote></div><br class=""></div></div></body></html>