[Cuis-dev] Would like to contribute

Hernán Wilkinson hernan.wilkinson at 10pines.com
Mon Sep 16 06:31:22 PDT 2024


In fact, for that case sending #remove: is just enough.

On Sat, Sep 14, 2024 at 10:24 AM Andres Valloud via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Speaking of duplicated code, does category understand findFirst:?
> Because if so...
>
>         | index |
>         index := aCategory findFirst: [:x | aName = x].
>         index = 0 ifTrue: [^blockToValue value].
>         aCategory removeAt: index.
>         ^aName
>
> On 9/13/24 4:47 PM, Damián Ortiz via Cuis-dev wrote:
> > Hello,
> >
> > I am Damian, a student in my second year of computer degree in
> > Universidad de Buenos Aires. Right now I am taking a class called
> > "Software engineering" whose professor is Hernan Wilkinson and we use
> > cuis university.
> >
> > While I was doing my homework which is about getting repeated code out,
> > I got a problem when I had repeated code in which the only instance
> > variables that changed were the ones called: active and suspended. I
> > decided to parametrize that code in another method in which both
> > suspended and active were replaced by category, and category was a
> > parameter. So the previous code was replaced by two lines, one calling
> > the method with active, and the other with suspended.
> >
> > However, you can not extract that variable as an argument. So I had to
> > do it manually, change all active and suspended, one by one.
> >
> > I think the fact of being able to parametrize a variable as an argument,
> > and also be able to parametrize it as an argument that already exists
> > (When it asks you for the name of the label, it detects if there is
> > already an argument called by that, it is parametrized as that already-
> > existed parameter).
> >
> > I would like you to tell me what you think about this change, and maybe
> > give me a hint to try to implement it. I do think this would help to
> > extract different-named objects/variables as a single parameter, and
> > also extract variables as parameters.
> >
> > Thank you for reading.
> >
> > I attach the code I talk about here (The given and the desired ones)
> >
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240916/1aa4cd54/attachment.htm>


More information about the Cuis-dev mailing list