Since ++ and -- wont see the light of day in ruby, can we use it for comment
notation?
define:
1. -- equal to # comment
2. --- (or more dashes) equal to =begin
next --- (or more) equal to =end
3. ++ same comment as #1 above
4. +++ same comment as #2 above
Reasons:
1. I like "--", very clean [1]
2. We can faq ++/-- questions as: "they are used for comments"
kind regards -botp
···
--
[1] Eg
cat a1.rb
-----------------------------------
Program Name: Sample_Programming.rb
Purpose: this a sample prg showing
- same as =begin and =end comments.
clean, don't you think so? imho
-----------------------------------
I also think that the =begin, =end notation is not comfortable to use.
Maybe some other way of multiline comments should be added in Ruby 1.9
for example /* */ or %c{ }
""Peña, Botp"" <botp@delmonte-phil.com> wrote in message
news:20050212025029.603D4824F@mx1.delmonte-phil.com...
···
Since ++ and -- wont see the light of day in ruby, can we use it for
comment
notation?
define:
1. -- equal to # comment
2. --- (or more dashes) equal to =begin
next --- (or more) equal to =end
3. ++ same comment as #1 above
4. +++ same comment as #2 above
Reasons:
1. I like "--", very clean [1]
2. We can faq ++/-- questions as: "they are used for comments"
kind regards -botp
--
[1] Eg
cat a1.rb
-----------------------------------
Program Name: Sample_Programming.rb
Purpose: this a sample prg showing
- same as =begin and =end comments.
clean, don't you think so? imho
-----------------------------------
I would like to see a multi-line that can nest other multi-line
comments. useful for quick and dirty code changes.
--- Disable this entire section
--- My other section that holds
important documentation.
···
On Sat, 12 Feb 2005 11:47:03 +0900, "Peña, Botp" <botp@delmonte-phil.com> wrote:
Since ++ and -- wont see the light of day in ruby, can we use it for comment
notation?
define:
1. -- equal to # comment
2. --- (or more dashes) equal to =begin
next --- (or more) equal to =end
3. ++ same comment as #1 above
4. +++ same comment as #2 above
---
code ... ...
---
so this is a problem. Lua has some interesting comments. They are ugly
but they have some nice uses. see http://www.lua.org/pil/1.3.html
(bottom half). Any ideas how we could clean it up a bit? I like the
single hyphen toggle.
define:
1. -- equal to # comment
2. --- (or more dashes) equal to =begin
next --- (or more) equal to =end
3. ++ same comment as #1 above
4. +++ same comment as #2 above
Reasons:
1. I like "--", very clean [1]
I understand that not everyone likes the hash-mark comment idiom. But
isn't this just another of the thousand things where it is literally
impossible for everyone to have it exactly how they want, and Matz has
gone ahead and made a reasonable decision? We can of course talk
about what looks best (and not agree), what's easiest to type (and not
agree), what will/won't make Perl/C/Java/etc. programmers feel at home
(and not agree about whether we care :-), and so forth. But that will
be true no matter what the comment mechanism is.
David
···
On Sat, 12 Feb 2005, [iso-8859-1] "Peña, Botp" wrote:
"Brian Mitchell" <binary42@gmail.com> wrote in message
news:fcfe4170050212060072e48cdb@mail.gmail.com...
···
On Sat, 12 Feb 2005 11:47:03 +0900, "Peña, Botp" <botp@delmonte-phil.com> > wrote:
Since ++ and -- wont see the light of day in ruby, can we use it for
comment
notation?
define:
1. -- equal to # comment
2. --- (or more dashes) equal to =begin
next --- (or more) equal to =end
3. ++ same comment as #1 above
4. +++ same comment as #2 above
I would like to see a multi-line that can nest other multi-line
comments. useful for quick and dirty code changes.
--- Disable this entire section
--- My other section that holds
important documentation.
---
code ... ...
---
+++ Disable this section
--- My other section that holds
important documentation.
---
code ... ...
+++
Since ++ and -- wont see the light of day in ruby, can we use it for comment
notation?
define:
1. -- equal to # comment
2. --- (or more dashes) equal to =begin
next --- (or more) equal to =end
3. ++ same comment as #1 above
4. +++ same comment as #2 above
I would like to see a multi-line that can nest other multi-line
comments. useful for quick and dirty code changes.
--- Disable this entire section
--- My other section that holds
important documentation.
---
code ... ...
---
so this is a problem. Lua has some interesting comments. They are ugly
but they have some nice uses. see Programming in Lua : 1.3
(bottom half). Any ideas how we could clean it up a bit? I like the
single hyphen toggle.
(In response to news:fcfe4170050212060072e48cdb@mail.gmail.com by Brian
Mitchell)
I would like to see a multi-line that can nest other multi-line
comments. useful for quick and dirty code changes.
See also this entry:
18.12: Why don't C comments nest? How am I supposed to comment out
code containing comments? Are comments legal inside quoted
strings?
the wild mate and nest normally. The San Diego Zoo believes it
has managed to convince some C comments to nest, but it's hard
to tell how much of that is really in the preprocessor, and how
much of it is just bovine fecal matter.
-- from the FAQ for comp.lang.c
k
···
A: We believe it has something to do with captivity; C comments in
David A. Black <dblack@wobblini.net> wrote:
> They've already seen the light of day:
>
> irb(main):001:0> ++ 100
> => 100
> irb(main):002:0> -- 100
> => 100
Interesting. What does that do? Integer identity op?
--
Jamis Buck
jamis_buck@byu.edu http://jamis.jamisbuck.org
------------------------------
"I am Victor of Borge. You will be assimil-nine-ed."