<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hello,<br>
<br>
I agree with you Eric. The example that you provide is rather
explicit.<br>
<br>
I also certainly agree on some simplifications about strings
parsing in Scilab 6.<br>
For instance, no longer allowing ending a string with the " or '
delimiter<br>
that has not been used to start it is a good thing.<br>
<br>
After 20 years of using Scilab, i discovered this week in a Xcos
block function<br>
that to include a " or ' in a string, doubling it is not
mandatory!<br>
Mixed " and ' can be used:<br>
<tt>--> "ab"'cde"</tt><tt><br>
</tt><tt> ans =</tt><tt><br>
</tt><tt> ab'cde</tt><tt><br>
</tt><tt><br>
</tt><tt>--> "ab'"cde"</tt><tt><br>
</tt><tt> ans =</tt><tt><br>
</tt><tt> ab"cde</tt><tt><br>
</tt><br>
Frankly, IMO this kind of dark feature remaining in Scilab 6.0
would deserve being<br>
removed. I guess that they do not simplify parsing strings, and
occurrences in<br>
the existing codes are trivial to detect and convert in the whole
code.<br>
By the way, this feature may prevent fixing the <a
href="http://bugzilla.scilab.org/show_bug.cgi?id=14287">request
14287</a>.<br>
<br>
<i>So, on one hand we still have this kind of dark complications,
and on the other</i><i><br>
</i><i>one a useful feature as continuing strings is removed...</i><i><br>
</i><br>
Another example showing a not very consistent policy:<br>
Scilab 6.0 brings block comments /*<br>
this is a multiline<br>
comment<br>
*/<br>
Even if they are poorly still supported, the way is right : they
will be really useful.<br>
<br>
<i>They implement a new multiline feature, while the multiline
strings parsing is removed..</i><i><br>
</i><br>
A last example about very handy multiline processing: It is
possible to declare<br>
a multiline array using the end-of-line as the ";" line separator.
This is also very<br>
useful, noticeably because it allows to copy/paste an array in the
code as <br>
is it displayed in the console:<br>
<tt>--> A = matrix(1:15,3,5)</tt><tt><br>
</tt><tt> A = </tt><tt><br>
</tt><tt> 1. 4. 7. 10. 13.</tt><tt><br>
</tt><tt> 2. 5. 8. 11. 14.</tt><tt><br>
</tt><tt> 3. 6. 9. 12. 15.</tt><br>
<br>
Now in the code to set A in a literal way:<br>
A = [<br>
<tt> 1. 4. 7. 10. 13.</tt><tt><br>
</tt><tt> 2. 5. 8. 11. 14.</tt><tt><br>
</tt><tt> 3. 6. 9. 12. 15.</tt><br>
]<br>
No need to append each line with ... or with ; or with ; ...<br>
Scilab is handy, and users are happy. They just expect that from
it.<br>
Nobody would suggest removing this feature.<br>
<br>
Back to strings: Octave uses "\" as the multiline continuation
character.<br>
It has this meaning only when it ends a line in an opened string.<br>
As it is currently implemented, it unfortunately requires being
protected if \ is<br>
used inside the string. This is not handy, and would bring many<br>
backward incompatibilities in Scilab<br>
>> a = " abcd \path\<br>
e"<br>
a = abcd pathe <<<< missing \ before p<br>
<br>
>> a = " abcd \\path\<br>
e"<br>
a = abcd \pathe<br>
<br>
<i>The way the continuation marks ... worked for strings up to
Scilab 5.5.2 was nice.</i><i><br>
</i><br>
We could even wonder that even removing ".." might be
syntactically possible:<br>
Any string not closed at the end of a line goes on on the next
line,<br>
and leading blanks are meaningful:<br>
<br>
text = "This is a unique<br>
string defined<br>
on several lines"<br>
<br>
Would it be hard to parse?<br>
Anyway, even without improvement, at least restoring the former
".." mark would<br>
remove a regression.<br>
<br>
Antoine,<br>
Fortunately, only Cédric and you known that the indeed horrible
example you gave was possible :((<br>
But the examples are not inside a string.<br>
For my part, i don't understand why preventing such -- possible
but unknown -- horrible syntax<br>
demands removing a useful feature.<br>
<br>
Now, i know that defining parsing rules is a very complex thing,
and that the parser has been rewritten.<br>
<br>
Best regards<br>
Samuel<br>
<br>
Le 09/09/2018 à 11:21, Éric Dubois a écrit :<br>
</div>
<blockquote
cite="mid:CAGgDjFQC6P4EXYm0n3x5xu3rCee6Af4tZ6HNOW1MK6BYr-P7zg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Thanks Antoine for your quick and precised
answer.
<div><br>
</div>
<div>I understand the point, but besides "ascending
compatibility" (which as a user I give -quite naturally-
more weight than you as a developper), it makes the
writing of long strings rather heavy and I think that an
exception should have been made for strings. In fact,
for long strings the solution you mention (and I
mentionned also in ly previous e-mail) consisting in
adding strings seems to mesomehow artificial, since it
amounts to build a variable by splitting it into several
ones.</div>
<div><br>
</div>
<div>As an example of my point, take the Troll code of the
macroeconomic model "Opale", that has been recently
realeased by the French Treasury (<a
moz-do-not-send="true"
href="https://www.tresor.economie.gouv.fr/Articles/2018/09/05/la-dg-tresor-met-a-la-disposition-du-public-les-codes-sources-des-modeles-mesange-opale-et-saphir">https://www.tresor.economie.gouv.fr/Articles/2018/09/05/la-dg-tresor-met-a-la-disposition-du-public-les-codes-sources-des-modeles-mesange-opale-et-saphir</a>).
Since Troll is proprietary and not Opensource software,
I have undertaken (and in fact managed) to translate it
into Scilab (which involves many blocks, sucha s a
symbolic derivativefor instance.</div>
<div><br>
</div>
<div>If you take an excerpt of the code that adds some
equations to an existing model, it is written in Troll :</div>
<div><br>
</div>
<div>ADDEQ bottom<br>
</div>
<div>
<div>td_p3m_d7_ch<span style="white-space:pre"> </span>:<span style="white-space:pre"> </span>DEL(1:
LOG(td_p3m_d7_ch)) = p3md7cst'c</div>
<div><span style="white-space:pre"> </span>
+ p3md7balpos'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>balpos</div>
<div><span style="white-space:pre"> </span>
+ p3md7balneg'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>balneg</div>
<div><span style="white-space:pre"> </span>
+ p3md7juppos'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>juppos</div>
<div><span style="white-space:pre"> </span>
+ p3md7jupneg'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>jupneg</div>
<div><span style="white-space:pre"> </span>
+ p3md7filneg'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>filneg</div>
<div><span style="white-space:pre"> </span>
+ p3md7indic1999q3'c*<span style="white-space:pre"> </span>indic1999q3</div>
<div><span style="white-space:pre"> </span>
+ p3md7rdbr0'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(LOG(TD_B6_S143/TD_P3M_D5_CH))</div>
<div><span style="white-space:pre"> </span>
+ p3md7rdbr1'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(LOG(TD_B6_S143/TD_P3M_D5_CH))(-1)</div>
<div><span style="white-space:pre"> </span>+
p3md7tcho0'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(TCHO)<span style="white-space:pre"> </span></div>
<div><span style="white-space:pre"> </span>+
p3md7vs0'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(TEMPVS1)</div>
<div><span style="white-space:pre"> </span>+
mup3md7'c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>(<span style="white-space:pre"> </span></div>
<div><span style="white-space:pre"> </span>LOG(td_p3m_d7_ch(-1))
-<span style="white-space:pre"> </span>p3m_d7_ch_cale(-1)</div>
<div><span style="white-space:pre"> </span>-
1 * LOG(TD_B6_S143(-1)/TD_P3M_D5_CH(-1))</div>
<div><span style="white-space:pre"> </span>)</div>
<div><span style="white-space:pre"> </span>+
DEL(p3m_d7_ch_cale),</div>
<div><span style="white-space:pre"> </span></div>
<div>td_p3p_d7_ch <span style="white-space:pre"> </span>:
td_p3p_d7_ch <span style="white-space:pre"> </span>=
coefp3pd7_ch<span style="white-space:pre"> </span>*
td_p3g_d7_ch ,<span style="white-space:pre"> </span></div>
<div><span style="white-space:pre"> </span></div>
<div>td_p51s_dhfz7_ch : DEL(LOG(td_p51s_dhfz7_ch)) =
-0.002801</div>
<div><span style="white-space:pre"> </span>+
0.257006<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>(DEL(LOG(td_p51s_dhfz7_ch(-2)))-DEL(p51s_dhfz7_ch_cale(-2)))</div>
<div> - 0.592343<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(LOG(td_p51s_dhfz5_ch/TD_B1_BMNA5_CH))</div>
<div> + 1.363988<span style="white-space:pre"> </span>
* <span style="white-space:pre"> </span>DEL(LOG(td_b1_bmna7_ch))</div>
<div> + 0.002681<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(TUC)
// ça devrait être DEL(TUC)(-1) => à changer</div>
<div><span style="white-space:pre"> </span>-
0.093789<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>(</div>
<div><span style="white-space:pre"> </span>LOG(td_p51s_dhfz7_ch(-1))-
LOG(td_b1_bmna7_ch(-1)) -</div>
<div><span style="white-space:pre"> </span>(<span style="white-space:pre"> </span>-1.854938<span style="white-space:pre"> </span>-0.018102
* COUT_REEL(-1)<span style="white-space:pre"> </span>)</div>
<div><span style="white-space:pre"> </span>-
p51s_dhfz7_ch_cale(-1)<span style="white-space:pre"> </span>)</div>
<div><span style="white-space:pre"> </span>+
DEL(p51s_dhfz7_ch_cale),</div>
</div>
<div><br>
</div>
<div>In Scilab 5.5.2 it should be written:</div>
<div>
<div><br>
</div>
<div>ADDEQ('bottom','...<br>
</div>
<div>
<div>td_p3m_d7_ch<span style="white-space:pre"> </span>:<span style="white-space:pre"> </span>DEL(1:
LOG(td_p3m_d7_ch)) = p3md7cst''c ...</div>
<div><span style="white-space:pre"> </span>
+ p3md7balpos''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>balpos
...</div>
<div><span style="white-space:pre"> </span>
+ p3md7balneg''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>balneg
...</div>
<div><span style="white-space:pre"> </span>
+ p3md7juppos''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>juppos
...</div>
<div><span style="white-space:pre"> </span>
+ p3md7jupneg''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>jupneg
...</div>
<div><span style="white-space:pre"> </span>
+ p3md7filneg''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>filneg
...</div>
<div><span style="white-space:pre"> </span>
+ p3md7indic1999q3''c*<span style="white-space:pre"> </span>indic1999q3
...</div>
<div><span style="white-space:pre"> </span>
+ p3md7rdbr0''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(LOG(TD_B6_S143/TD_P3M_D5_CH))
...</div>
<div><span style="white-space:pre"> </span>
+ p3md7rdbr1''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(LOG(TD_B6_S143/TD_P3M_D5_CH))(-1)
...</div>
<div><span style="white-space:pre"> </span>+
p3md7tcho0''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(TCHO)
... <span style="white-space:pre"> </span></div>
<div><span style="white-space:pre"> </span>+
p3md7vs0''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(TEMPVS1)
...</div>
<div><span style="white-space:pre"> </span>+
mup3md7''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>(<span style="white-space:pre"> </span> ...<span style="white-space:pre"> </span></div>
<div><span style="white-space:pre"> </span>LOG(td_p3m_d7_ch(-1))
-<span style="white-space:pre"> </span>p3m_d7_ch_cale(-1)
...</div>
<div><span style="white-space:pre"> </span>-
1 * LOG(TD_B6_S143(-1)/TD_P3M_D5_CH(-1)) ...</div>
<div><span style="white-space:pre"> </span>)
... </div>
<div><span style="white-space:pre"> </span>+
DEL(p3m_d7_ch_cale), ...</div>
<div><span style="white-space:pre"> </span> ...<span style="white-space:pre"> </span></div>
<div>td_p3p_d7_ch <span style="white-space:pre"> </span>:
td_p3p_d7_ch <span style="white-space:pre"> </span>=
coefp3pd7_ch<span style="white-space:pre"> </span>*
td_p3g_d7_ch ,<span style="white-space:pre"> </span> ...</div>
<div> ...<span style="white-space:pre"> </span></div>
<div>td_p51s_dhfz7_ch : DEL(LOG(td_p51s_dhfz7_ch)) =
-0.002801 ...</div>
<div><span style="white-space:pre"> </span>+
0.257006<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>(DEL(LOG(td_p51s_dhfz7_ch(-2)))-DEL(p51s_dhfz7_ch_cale(-2)))
...</div>
<div> - 0.592343<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(LOG(td_p51s_dhfz5_ch/TD_B1_BMNA5_CH))
...</div>
<div> + 1.363988<span style="white-space:pre"> </span>
* <span style="white-space:pre"> </span>DEL(LOG(td_b1_bmna7_ch))
...</div>
<div> + 0.002681<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(TUC)
...</div>
<div><span style="white-space:pre"> </span>-
0.093789<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>(
...</div>
<div><span style="white-space:pre"> </span>LOG(td_p51s_dhfz7_ch(-1))-
LOG(td_b1_bmna7_ch(-1)) - ...</div>
<div><span style="white-space:pre"> </span>(<span style="white-space:pre"> </span>-1.854938<span style="white-space:pre"> </span>-0.018102
* COUT_REEL(-1)<span style="white-space:pre"> </span>)
...</div>
<div><span style="white-space:pre"> </span>-
p51s_dhfz7_ch_cale(-1)<span style="white-space:pre"> </span>)
...</div>
<div><span style="white-space:pre"> </span>+
DEL(p51s_dhfz7_ch_cale)')</div>
</div>
<br class="gmail-Apple-interchange-newline">
</div>
<div>And in Scilab 6.0.1:</div>
<div>
<div>ADDEQ('bottom','...<br>
</div>
<div>
<div>td_p3m_d7_ch<span style="white-space:pre"> </span>:<span style="white-space:pre"> </span>DEL(1:
LOG(td_p3m_d7_ch)) = p3md7cst''c'+ ...</div>
<div><span style="white-space:pre"> </span>
'+ p3md7balpos''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>balpos'+
...</div>
<div><span style="white-space:pre"> </span>
'+ p3md7balneg''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>balneg'+
...</div>
<div><span style="white-space:pre"> </span>
'+ p3md7juppos''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>juppos'+
...</div>
<div><span style="white-space:pre"> </span>
'+ p3md7jupneg''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>jupneg'+
...</div>
<div><span style="white-space:pre"> </span>
'+ p3md7filneg''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>filneg'+
...</div>
<div><span style="white-space:pre"> </span>
'+ p3md7indic1999q3''c*<span style="white-space:pre"> </span>indic1999q3
...</div>
<div><span style="white-space:pre"> </span>
' + p3md7rdbr0''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(LOG(TD_B6_S143/TD_P3M_D5_CH))'+
...</div>
<div><span style="white-space:pre"> </span>
'+ p3md7rdbr1''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(LOG(TD_B6_S143/TD_P3M_D5_CH))(-1)'+
...</div>
<div><span style="white-space:pre"> </span>'+
p3md7tcho0''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(TCHO)
'+ ... <span style="white-space:pre"> </span></div>
<div><span style="white-space:pre"> </span>'+
p3md7vs0''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(TEMPVS1)'+
...</div>
<div><span style="white-space:pre"> </span>'+
mup3md7''c<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>('+<span style="white-space:pre"> </span> ...<span style="white-space:pre"> </span></div>
<div><span style="white-space:pre"> </span>'LOG(td_p3m_d7_ch(-1))
-<span style="white-space:pre"> </span>p3m_d7_ch_cale(-1)'+
...</div>
<div><span style="white-space:pre"> </span>'-
1 * LOG(TD_B6_S143(-1)/TD_P3M_D5_CH(-1)) '+...</div>
<div><span style="white-space:pre"> </span>')'+
... </div>
<div><span style="white-space:pre"> </span>'+
DEL(p3m_d7_ch_cale),'+ ...</div>
<div><span style="white-space:pre"> </span> +...<span style="white-space:pre"> </span></div>
<div>'td_p3p_d7_ch <span style="white-space:pre"> </span>:
td_p3p_d7_ch <span style="white-space:pre"> </span>=
coefp3pd7_ch<span style="white-space:pre"> </span>*
td_p3g_d7_ch ,'+<span style="white-space:pre"> </span> ...</div>
<div> + ...<span style="white-space:pre"> </span></div>
<div>'td_p51s_dhfz7_ch : DEL(LOG(td_p51s_dhfz7_ch)) =
-0.002801
'+ ...</div>
<div><span style="white-space:pre"> </span>'+
0.257006<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>(DEL(LOG(td_p51s_dhfz7_ch(-2)))-DEL(p51s_dhfz7_ch_cale(-2)))'+
...</div>
<div> ' - 0.592343<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(LOG(td_p51s_dhfz5_ch/TD_B1_BMNA5_CH))'+
...</div>
<div> '+ 1.363988<span style="white-space:pre"> </span>
* <span style="white-space:pre"> </span>DEL(LOG(td_b1_bmna7_ch))'+
...</div>
<div> '+ 0.002681<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>DEL(TUC)'+
...</div>
<div><span style="white-space:pre"> </span>'-
0.093789<span style="white-space:pre"> </span>*<span style="white-space:pre"> </span>('+
...</div>
<div><span style="white-space:pre"> </span>'+LOG(td_p51s_dhfz7_ch(-1))-
LOG(td_b1_bmna7_ch(-1)) - '+...</div>
<div><span style="white-space:pre"> </span>'(<span style="white-space:pre"> </span>-1.854938<span style="white-space:pre"> </span>-0.018102
* COUT_REEL(-1)<span style="white-space:pre"> </span>)
'+...</div>
<div><span style="white-space:pre"> </span>'-
p51s_dhfz7_ch_cale(-1)<span style="white-space:pre"> </span>)
'+...</div>
<div><span style="white-space:pre"> </span>'+
DEL(p51s_dhfz7_ch_cale)')</div>
</div>
<div><br>
</div>
<div>For an economist point of view the last writing
makes it much more difficult the understanding of the
structure of the equations and I fear that it could
make external users reluctant to use my code...</div>
<div><br>
</div>
<div>Regards,</div>
<br class="gmail-Apple-interchange-newline">
</div>
<div>Éric</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">Le sam. 8 sept. 2018 à 10:41, Éric Dubois <<a
moz-do-not-send="true"
href="mailto:grocer.toolbox@gmail.com" target="_blank">grocer.toolbox@gmail.com</a>>
a écrit :<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello
<div><br>
</div>
<div>Can someone explain me why in Scilab 6, you cannot
wirte a string on several lines each line ending by "..."?</div>
<div><br>
</div>
<div>When you have a very long string, you have 2 choices
that are not appealing:</div>
<div>- write this string on a line, which is not very
readable;</div>
<div>- define several strings covering different components
of the string and then add them to build your string,
which is a time consuming.</div>
<div><br>
</div>
<div>This change makes my productivity when programming in
Scilab decline and I do not see teh drawbacks that the old
working entailed.</div>
<div><br>
</div>
<div>Thansk for your answer.</div>
<div><br>
</div>
<div>Regards </div>
<div><br>
</div>
<div>Éric</div>
<div><br>
</div>
</div>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/dev">http://lists.scilab.org/mailman/listinfo/dev</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>