egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ucomment

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Slaktarn
Halfop


Joined: 02 May 2007
Posts: 44

PostPosted: Sat Mar 20, 2010 1:57 am    Post subject: Ucomment Reply with quote

Hay everyone then it was time again....

1: The only way i have found to ucomment in TCL is #

2: But i try to find a way to do it like C++ or PHP

I need to do



Code:

# My comment
Code


But i wuld like to do something like

Code:

/* MyComment */ Code


/Slaktarn
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Mar 20, 2010 9:56 am    Post subject: Reply with quote

That is true, the only way to create a comment in tcl is by using the hash-character (#). Unless you feel like re-writing your tcl-library, don't expect to change this behaviour...
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Slaktarn
Halfop


Joined: 02 May 2007
Posts: 44

PostPosted: Sat Mar 20, 2010 1:42 pm    Post subject: Reply with quote

nml375 wrote:
That is true, the only way to create a comment in tcl is by using the hash-character (#). Unless you feel like re-writing your tcl-library, don't expect to change this behaviour...


Donīt you think its bad that its only way to do it

You canīt make notes on same row before a code just after and onn a own row its insane. Considering there its a old language and shuld be away to do it. My opinion relly strange

/Slaktarn
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Mar 20, 2010 2:13 pm    Post subject: Reply with quote

Slaktarn wrote:
nml375 wrote:
That is true, the only way to create a comment in tcl is by using the hash-character (#). Unless you feel like re-writing your tcl-library, don't expect to change this behaviour...


Donīt you think its bad that its only way to do it

You canīt make notes on same row before a code just after and onn a own row its insane. Considering there its a old language and shuld be away to do it. My opinion relly strange

/Slaktarn


Code:
set b "huh" ; # comment
set c "exactly" ; # another comment

Putting comments before code is meant for compiled languages, tcl is interpreted. Therefore comments need to go "; #after" code, or on a line of their own. This simplifies the constructs the parser needs to recognize to see the item as a comment.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Slaktarn
Halfop


Joined: 02 May 2007
Posts: 44

PostPosted: Sat Mar 20, 2010 3:21 pm    Post subject: Reply with quote

speechles wrote:


Code:
set b "huh" ; # comment
set c "exactly" ; # another comment

Putting comments before code is meant for compiled languages, tcl is interpreted. Therefore comments need to go "; #after" code, or on a line of their own. This simplifies the constructs the parser needs to recognize to see the item as a comment.


Hehe so the only way to do it is the way you show... Hoever im not so good in TCL you seems to be relly good.

; is to tells that its the end of code/line right so its batter to have

Code:

1: set a [lindex 1] ; # Comment
2: set b [lindex 1] # Comment


Then the exampel 1 is batter then exampel 2 i guss

/ Slaktarn
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Mar 20, 2010 5:36 pm    Post subject: Reply with quote

Slaktarn wrote:
nml375 wrote:
That is true, the only way to create a comment in tcl is by using the hash-character (#). Unless you feel like re-writing your tcl-library, don't expect to change this behaviour...


Donīt you think its bad that its only way to do it

You canīt make notes on same row before a code just after and onn a own row its insane. Considering there its a old language and shuld be away to do it. My opinion relly strange

/Slaktarn

Nope, it's the way tcl works, and it works well enough for me...
And frankly, C is far older than tcl...

Honestly, I can't even see the problem with not being able to put comments in front of a line of code.. To me, that'd just make the whole piece of code harder to read, but then again, that's just my humble opinion..

I suppose you've got an issue with the way you comment code in bash-scripts too?
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber