Tom Prince writes:
> Perhaps
>
> ,---
> | (defun main-function (args)
> | (let ((var (assoc :key1 args))) ; extracting var once
> | ...
> | (helper-f
[...]
>> Would that be considered bad style from the original author, or is that
>> up to personal choice and not considered a problem?
>>
>
> Not a problem - you can't predict the future. You do the best you can
> with your current knowledge. You can always refactor in the future:
> that's one
Perhaps
,---
| (defun main-function (args)
| (let ((var (assoc :key1 args))) ; extracting var once
| ...
| (helper-function1 ... var ...) ; inside let
Tassilo Horn writes:
> And I wouldn't tell multiple similar let-bindings duplicate code.
I have to get used to that, at first sight it looks like there is
redundancy everywhere. But its more from the Java perspective, from the
more functional perspective it makes sense.
cheers
--
Thorsten
Nick Dokos writes:
> Not a problem - you can't predict the future. You do the best you can
> with your current knowledge. You can always refactor in the future:
> that's one reason that having the source code around is important. When
> you refactor, you may be cursing the original author for th
Eric Schulte writes:
Hi Eric,
> Hmmm, this looks suspiciously like the case in some Babel functions :)
well ... ;)
> in which we originally has instances of the first style and then had to
> manually transition to the second. IMO the first is very poor form, the
> variables are technically "
Tassilo Horn writes:
> Thorsten writes:
>
>>> Too bad you didn't give any concrete examples.
>>
>> The problem can be described easily:
>>
>> problem-specific helper-funcions (some redundancy avoided)
>> ,---
>> | (defun main-function (arg
>
> The problem can be described easily:
>
> problem-specific helper-funcions (some redundancy avoided)
> ,---
> | (defun main-function (args)
> | (let ((var (assoc :key1 args))) ; extracting var once
> | ...
Thorsten writes:
>> Too bad you didn't give any concrete examples.
>
> The problem can be described easily:
>
> problem-specific helper-funcions (some redundancy avoided)
> ,---
> | (defun main-function (args)
Thorsten wrote:
> Štěpán Němec writes:
>
> > On Thu, 27 Oct 2011 20:03:22 +0200
> > Thorsten wrote:
> >
> >> Hi List, doing some Elisp programming (in an orgmode context)
> >> recently, the following question with regards to the 'accepted
> >> programming style' for Elisp concerned me:
> >>
> >
Štěpán Němec writes:
> On Thu, 27 Oct 2011 20:03:22 +0200
> Thorsten wrote:
>
>> Hi List, doing some Elisp programming (in an orgmode context)
>> recently, the following question with regards to the 'accepted
>> programming style' for Elisp concerned me:
>>
>> How independent and self-sustained s
On Thu, 27 Oct 2011 20:03:22 +0200
Thorsten wrote:
> Hi List,
> doing some Elisp programming (in an orgmode context) recently, the
> following question with regards to the 'accepted programming style' for
> Elisp concerned me:
>
> How independent and self-sustained should helper functions be?
>
Hi List,
doing some Elisp programming (in an orgmode context) recently, the
following question with regards to the 'accepted programming style' for
Elisp concerned me:
How independent and self-sustained should helper functions be?
I found some redundancy in elisp code, e.g. several (main and h
13 matches
Mail list logo