Author Topic: Comments  (Read 10729 times)

0 Members and 1 Guest are viewing this topic.

Slimİ

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
Re: Comments
« Reply #30 on: March 09, 2006, 02:26:37 PM »
I drink beer and I know things....

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Comments
« Reply #31 on: March 09, 2006, 02:32:13 PM »
« Last Edit: March 09, 2006, 02:38:31 PM by ElpanovEvgeniy »

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Comments
« Reply #32 on: March 09, 2006, 03:11:02 PM »
Yes, in that situation i would use closing statments too. :D
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Bobby C. Jones

  • Swamp Rat
  • Posts: 516
  • Cry havoc and let loose the dogs of war.
Re: Comments
« Reply #33 on: March 09, 2006, 03:15:38 PM »
Yes, in that situation i would use closing statments too. :D

I would tend to break out the code doing all those calculations into separate functions :D
Bobby C. Jones

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Comments
« Reply #34 on: March 09, 2006, 03:21:03 PM »
In the beginning I create the list...
Then it(him) I shall update many times...
Then I end the program.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Comments
« Reply #35 on: March 09, 2006, 03:26:49 PM »
Personally, I couldn't work in code with those line ending comments.

... because they are there, my eyes think they are important, then my brain says no they're not. After this happens a few times, I start to get annoyed with being interupted.

« Last Edit: March 09, 2006, 03:32:23 PM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Comments
« Reply #36 on: March 09, 2006, 03:34:47 PM »
Everything, at a forum, do not like comments.
Very well!
I shall format the code for a forum...
 :?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Comments
« Reply #37 on: March 09, 2006, 03:36:56 PM »
No No No No

Evgeniy,

People are just saying what they prefer, not telling you what to do !   :-)

Normal conversation ...
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Comments
« Reply #38 on: March 09, 2006, 03:59:55 PM »
>ALL
Select...
1
Code: [Select]
(defun multi-subst-fun (lst-i)
  (eval
    (list
      'defun
      'multi-subst
      '(lst)
      (list
        'mapcar
        (list 'function
              (list
                'lambda
                '(a)
                (cons
                  'cond
                  (reverse
                    (cons
                      '(t a)
                      (mapcar
                        '(lambda (a)
                           (list
                             (list
                               'equal
                               (car a)
                               'a
                             ) ;_  list
                             (cadr a)
                           ) ;_  list
                         ) ;_  lambda
                        lst-i
                      ) ;_  mapcar
                    ) ;_  cons
                  ) ;_  reverse
                ) ;_  cons
              ) ;_  list
        ) ;_  list
        'lst
      ) ;_  list
    ) ;_  list
  ) ;_  eval
) ;_  defun
;; do the test...
(multi-subst-fun '((1 "a") (3 "b")))

(multi-subst '(1 2 3 4 5))
(multi-subst '(1 6 4 3 7))
OR 2
Code: [Select]
(defun multi-subst-fun (lst-i)
  (eval
    (list
      'defun
      'multi-subst
      '(lst)
      (list
        'mapcar
        (list 'function
              (list
                'lambda
                '(a)
                (cons
                  'cond
                  (reverse
                    (cons
                      '(t a)
                      (mapcar
                        '(lambda (a)
                           (list
                             (list
                               'equal
                               (car a)
                               'a)
                             (cadr a)))
                        lst-i))))))
        'lst))))
;; do the test...
(multi-subst-fun '((1 "a") (3 "b")))

(multi-subst '(1 2 3 4 5))
(multi-subst '(1 6 4 3 7))

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Comments
« Reply #39 on: March 09, 2006, 04:01:26 PM »
Everything, at a forum, do not like comments.
Very well!
I shall format the code for a forum...
 :?

No. People like your code format. (They have said that its very nice.)

TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

LE

  • Guest
Re: Comments
« Reply #40 on: March 09, 2006, 04:46:38 PM »
>ALL
Select...
1
Code: [Select]
(defun multi-subst-fun (lst-i)
) ;_  defun
;; do the test...
(multi-subst-fun '((1 "a") (3 "b")))

(multi-subst '(1 2 3 4 5))
(multi-subst '(1 6 4 3 7))
OR 2
Code: [Select]
(defun multi-subst-fun (lst-i)
;; do the test...
(multi-subst-fun '((1 "a") (3 "b")))

(multi-subst '(1 2 3 4 5))
(multi-subst '(1 6 4 3 7))

Just being myself picky sometimes... that type of function is not readable, not easy to follow.

But that is just my opinion.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Comments
« Reply #41 on: March 09, 2006, 05:30:51 PM »
Only using comments, I do such functions...
 :-)  :-)  :-)

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Comments
« Reply #42 on: March 09, 2006, 06:18:27 PM »
I choose: 1
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org