<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Erik,<br>
<br>
On 5/1/2020 4:45 AM, Erik Stel via Cuis-dev wrote:
<blockquote
cite="mid:58C7E6FA-3621-441C-A73E-716633E863CB@gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Maybe I wasn’t clear (because it was part of another topic, see
below) or tread on a sensitive subject, but I’m still eager to
hear the reasoning for having backticks (which are not in Squeak
nor Pharo) from the simplicity point of view. Would anyone care to
elaborate?</blockquote>
<br>
Not from the simplicity point of view, but from the consistency
one...<br>
<br>
One of the nice properties of Smalltalk is that there is no special
objects. Your objects are on par with what the system provides.
(Compare with Java or C++ primitive types, etc). This is an ideal,
but Smalltalk gets pretty close to it.<br>
<br>
A literal is an object that is built by the Compiler when compiling
the method. It is not created on method execution. It is a single
instance that will be reused in every method invocation. In
Smalltalk-80, literals can be Strings, Symbols, Integers, Floats and
Arrays of these. But not Fractions. Or Points. Or instances of your
own classes. All these require message sending to be created, each
time. Backticks are a way to change that. So you can have literals
of any class. In some cases it can improve performance or reduce
memory usage. But the deeper reason is to put all classes in equal
footing with those privileged ones that are known by the Compiler.<br>
<br>
Many times the question 'what is the best option?' doesn't have an
obvious answer, and it is about tradeoffs. The question is not 'what
is the simplest option?' but 'does this complexity carry its own
weight?' This is more difficult to answer!<br>
<br>
<blockquote
cite="mid:58C7E6FA-3621-441C-A73E-716633E863CB@gmail.com"
type="cite">
<div class="">I am also eager to know what others think about
language constructs such as #(), {} and `` for daily usage. And
I mean this in the sense ‘Do you use these often? Could you live
without them?’. I do understand how they can be used and what
their meaning is ;-). And I can also lookup their current use in
the default image, but that does not answer how you/we use them
in our (application) code.</div>
<div class=""><br class="">
</div>
<div class="">Kind regards,</div>
<div class="">Erik<br>
</div>
</blockquote>
<br>
I use {} a lot. Not for modeling suff, but for example as a
debugging aid.When trying to understand what some code does, I might
insert a line like:<br>
{ 'what is this stuff?'. someObject. 'and here...'. some message
send } print.<br>
<br>
I use #() for more system level code. For example the implementors
of #is: . The reason here is efficiency.<br>
<br>
I use `` for stuff that could be literals if we had syntax for them.
Constant points are the obvious example. But there might be others.
Perhaps `Float pi` is a good example. Why would 1.0 be a literal but
Float pi needs to be evaluated every time? Doesn't make sense to me.
Both are Float constants.<br>
<br>
In other message you talk about Sets. Backticks means we don't need
a specific syntax for Sets: `{ 1. 3. 5. 7. 11. 13} asSet` will do.<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</body>
</html>