<div dir="ltr">Something like:<div><br></div><div>from __syntax__ import decimal_literal</div><div><br></div><div>which would feed the rest of the file through the "decimal_literal" transpiler.</div><div>(and not influence anything in other files). </div><div><br></div><div>Not sure if you would want to support multiple transpilers per file.</div><div><br></div><div>Note that Racket has something similar with their initial "#lang ..." directive.</div><div>That only allows a single "language". Possibly wisely so.</div><div><br></div><div>Stephan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-12 12:59 GMT+01:00 אלעזר <span dir="ltr"><<a href="mailto:elazarg@gmail.com" target="_blank">elazarg@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">I think such proposals are special cases of a general theme: a compiler pragma, similar to "from __future__", to make Python support domain-specific syntax in the current file. Whether it's decimal literals or matrix/vector literals etc. </p>
<p dir="ltr">I think it will be nice to make some tool, external to Python, that will allow defining such "sibling languages" (transpiled into Python) easily and uniformly.</p>
<p dir="ltr">Elazar </p>
<br><div class="gmail_quote"><div dir="ltr">בתאריך יום ה׳, 12 בינו' 2017, 13:21, מאת Paul Moore <<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>>:<br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 12 January 2017 at 10:28, Victor Stinner <<a href="mailto:victor.stinner@gmail.com" class="m_-9153359223763791002gmail_msg" target="_blank">victor.stinner@gmail.com</a>> wrote:<br class="m_-9153359223763791002gmail_msg">
> George requested this feature on the bug tracker:<br class="m_-9153359223763791002gmail_msg">
> <a href="http://bugs.python.org/issue29223" rel="noreferrer" class="m_-9153359223763791002gmail_msg" target="_blank">http://bugs.python.org/<wbr>issue29223</a><br class="m_-9153359223763791002gmail_msg">
><br class="m_-9153359223763791002gmail_msg">
> George was asked to start a discusson on this list. I posted the<br class="m_-9153359223763791002gmail_msg">
> following comment before closing the issue:<br class="m_-9153359223763791002gmail_msg">
><br class="m_-9153359223763791002gmail_msg">
> You are not the first one to propose the idea.<br class="m_-9153359223763791002gmail_msg">
<br class="m_-9153359223763791002gmail_msg">
OK, but without additional detail (for example, how would the proposed<br class="m_-9153359223763791002gmail_msg">
flag work, if the main module imports module A, then would float<br class="m_-9153359223763791002gmail_msg">
literals in A be decimal or binary? Both could be what the user wants)<br class="m_-9153359223763791002gmail_msg">
it's hard to comment. And as you say, most of this has been discussed<br class="m_-9153359223763791002gmail_msg">
before, so I'd like to see references back to the previous discussions<br class="m_-9153359223763791002gmail_msg">
in any proposal, with explanations of how the new proposal addresses<br class="m_-9153359223763791002gmail_msg">
the objections raised previously.<br class="m_-9153359223763791002gmail_msg">
<br class="m_-9153359223763791002gmail_msg">
Paul<br class="m_-9153359223763791002gmail_msg">
______________________________<wbr>_________________<br class="m_-9153359223763791002gmail_msg">
Python-ideas mailing list<br class="m_-9153359223763791002gmail_msg">
<a href="mailto:Python-ideas@python.org" class="m_-9153359223763791002gmail_msg" target="_blank">Python-ideas@python.org</a><br class="m_-9153359223763791002gmail_msg">
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" class="m_-9153359223763791002gmail_msg" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br class="m_-9153359223763791002gmail_msg">
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" class="m_-9153359223763791002gmail_msg" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br class="m_-9153359223763791002gmail_msg">
</blockquote></div></div></div>
<br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br></blockquote></div><br></div>