Refactoring idea
Mickaël Rémond <[email protected]> Sat, 24 Nov 2007 14:45:31 +0100
| Newsgroups | gmane.comp.lang.erlang.distel.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============0624458881==
Content-Type: multipart/alternative; boundary=Apple-Mail-13-708883075
--Apple-Mail-13-708883075
Content-Type: text/plain;
charset=UTF-8;
format=flowed;
delsp=yes
Content-Transfer-Encoding: quoted-printable
Hello,
I am not a good Lisp coder, but I can however shared ideas :)
I find that I am doing very often this kind of refatoring
Result =3D function(...),
to:
case function(...) of
Result ->
;
_ ->
;
end,
This is frequent when I add error management in the code: First =20
version is straightforward, assuming a result, second version add =20
alternative path in the code.
What do you think ?
--=20
Micka=C3=ABl R=C3=A9mond
http://www.process-one.net/
--Apple-Mail-13-708883075
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; ">Hello,<div><br =
class=3D"webkit-block-placeholder"></div><div>I am not a good Lisp =
coder, but I can however shared ideas :)</div><div><br =
class=3D"webkit-block-placeholder"></div><div>I find that I am doing =
very often this kind of refatoring</div><div><br =
class=3D"webkit-block-placeholder"></div><div><font =
class=3D"Apple-style-span" face=3D"Monaco"> Result =3D =
function(...),</font></div><div><br =
class=3D"webkit-block-placeholder"></div><div>to:</div><div><br></div><div=
><font class=3D"Apple-style-span" face=3D"Monaco"> =
case function(...) of</font></div><div><font =
class=3D"Apple-style-span" face=3D"Monaco"><span class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </span>Result -><br =
class=3D"webkit-block-placeholder"></font></div><div><font =
class=3D"Apple-style-span" face=3D"Monaco"><span class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </span>;<br =
class=3D"webkit-block-placeholder"></font></div><div><font =
class=3D"Apple-style-span" face=3D"Monaco"><span class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </span>_ -><br =
class=3D"webkit-block-placeholder"></font></div><div><font =
class=3D"Apple-style-span" face=3D"Monaco"><span class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </span>;<br =
class=3D"webkit-block-placeholder"></font></div><div><font =
class=3D"Apple-style-span" face=3D"Monaco"> =
end,</font></div><div><br =
class=3D"webkit-block-placeholder"></div><div>This is frequent when I =
add error management in the code: First version is straightforward, =
assuming a result, second version add alternative path in the =
code.</div><div><br class=3D"webkit-block-placeholder"></div><div>What =
do you think ?</div><div><br><div apple-content-edited=3D"true"> <span =
class=3D"Apple-style-span" style=3D"border-collapse: separate; color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: =
normal; font-variant: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; orphans: 2; text-align: auto; text-indent: =
0px; text-transform: none; white-space: normal; widows: 2; word-spacing: =
0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div><div style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span =
class=3D"Apple-style-span" style=3D"font-size: 12px; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; =
"><div>-- </div><div>Micka=C3=ABl R=C3=A9mond</div><div> <a =
href=3D"http://www.process-one.net/">http://www.process-one.net/</a></div>=
<div><br =
class=3D"webkit-block-placeholder"></div></div></span></div></div></div></=
span><br class=3D"Apple-interchange-newline"> =
</div><br></div></body></html>=
--Apple-Mail-13-708883075--
--===============0624458881==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--===============0624458881==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Distel-hackers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/distel-hackers
--===============0624458881==--