<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Eze,<br>
<br>
Your code would make this fail:<br>
(1 to: 10) select: [ :i | i even ] thenCollect: [ :i | i * 2 ]<br>
<br>
So, I just pushed the two new methods.<br>
<br>
Thanks,<br>
<br>
On 3/7/2025 1:40 PM, Ezequiel Birman via Cuis-dev wrote:
<blockquote
cite="mid:CAOo=t4exhtjiZeqU9XhgF_s_tcf55urwkn6--cBZ4-CTvrLwsQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>There was a typo. Here's the corrected version.<br>
<br>
-- <br>
</div>
Eze</div>
<br>
<div class="gmail_quote gmail_quote_container">
<div dir="ltr" class="gmail_attr">On Fri, 7 Mar 2025 at 16:24,
Ezequiel Birman <<a moz-do-not-send="true"
href="mailto:ebirman77@gmail.com">ebirman77@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div dir="ltr">Hello<br>
<br>
<div>I wanted a <b>reject:thenDo:</b>. so instead of:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">| taskbar userInterface |<br>
<br>
"If we were to ommit this, the taskbar wouldn't exist
yet, and therefore taskbar would be initialized to nil"<br>
<b>self runningWorld doOneCycleNow.</b><br>
<b><br>
userInterface := UISupervisor ui.<br>
taskbar := userInterface taskbar.</b><br>
<br>
"Remove all morphs except for the taskbar. We also leave
code windows intact in case we are recovering from a
crash."<br>
<b>userInterface submorphs</b><br>
<b> select: [ :morph | (morph isKindOf: CodeWindow)
not and: [ morph ~= taskbar ]]</b><br>
<b> thenDo: #delete.</b></blockquote>
<br>
</div>
<div>I can rewrite:<br>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">"Remove all morphs except for the
taskbar. We also leave code windows intact in case we
are recovering from a crash."<br>
<b>userInterface submorphs</b><br>
<b> reject: [ :morph | (morph isKindOf: CodeWindow)
or: [ morph = taskbar ]]</b><br>
<b> thenDo: #delete.</b></blockquote>
</div>
<div><br>
While I was at it, I refactored <b>select:ThenCollect:</b>
to avoid iterating twice, then added a <b>reject:thenCollect:</b>
just for the sake of symmetry.<br>
<br>
</div>
<div>I attach the changeset in case you find it useful; but
I wanted to know what is your opinion on adding tests that
exercise higher-level messages like these. If they are
needed or wanted, I can also add them to BaseImageTests.<br>
<br>
-- <br>
</div>
<div>Eze</div>
</div>
</blockquote>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
</body>
</html>