Re: [O] Elisp programming style

2011-10-29 Thread Thorsten
Tom Prince writes: > Perhaps > > ,--- > | (defun main-function (args) > | (let ((var (assoc :key1 args))) ; extracting var once > | ... > | (helper-f

Re: [O] Elisp programming style

2011-10-28 Thread Eric Abrahamsen
[...] >> 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

Re: [O] Elisp programming style

2011-10-28 Thread Tom Prince
Perhaps ,--- | (defun main-function (args) | (let ((var (assoc :key1 args))) ; extracting var once | ... | (helper-function1 ... var ...) ; inside let

Re: [O] Elisp programming style

2011-10-28 Thread Thorsten
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

Re: [O] Elisp programming style

2011-10-28 Thread 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

Re: [O] Elisp programming style

2011-10-28 Thread Thorsten
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 "

Re: [O] Elisp programming style

2011-10-28 Thread Eric Schulte
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

Re: [O] Elisp programming style

2011-10-28 Thread Eric Schulte
> > 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 > | ...

Re: [O] Elisp programming style

2011-10-28 Thread Tassilo Horn
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)

Re: [O] Elisp programming style

2011-10-28 Thread Nick Dokos
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: > >> > >

Re: [O] Elisp programming style

2011-10-28 Thread Thorsten
Š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

Re: [O] Elisp programming style

2011-10-28 Thread Štěpán Němec
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? >

[O] Elisp programming style

2011-10-27 Thread Thorsten
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