seem to be Cobra make a constructor into static class.
did not pass to compile.
or..., forgot to write a keyword or something that I ?
Forums
static class problem
11 posts
• Page 1 of 2 • 1, 2
Re: static class problem
sorry, I had forgotten the sample code is taken care of translation
it is as follows:
it is as follows:
@args t:lib
class AdditionalName is shared
pro cobra as String is shared
get
return "Arisawa"
- arisawa
- Posts: 51
Re: static class problem
At the very least, you need a "set" to complete the "pro".
Also, I don't think Cobra supports "shared" at the class level, but you could do this:
Maybe that helps.
Also, we're now giving support at http://cobra-language.com/trac/cobra/wiki/IrcChannel as well. And webnov8 is working on a cobrabot in Cobra to do the logging.
Also, I don't think Cobra supports "shared" at the class level, but you could do this:
class X
shared
pro x as int
get
return 0
set
pass
def hello
print 'hi'
Also, we're now giving support at http://cobra-language.com/trac/cobra/wiki/IrcChannel as well. And webnov8 is working on a cobrabot in Cobra to do the logging.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: static class problem
support thanks.
by the way, I was ready to participate in the IRC.
however, I am not English speaker.
I requires a lot of time on writing and reading.
may be heavy load for me.
can you still support in the forum?
by the way, I was ready to participate in the IRC.
however, I am not English speaker.
I requires a lot of time on writing and reading.
may be heavy load for me.
can you still support in the forum?
- arisawa
- Posts: 51
Re: static class problem
Oh sure. We'll always support in both the forum and irc from now on. They have pros and cons.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: static class problem
Also, I don't think Cobra supports "shared" at the class level,
Is there a particular philosophical reason for that or is it just an NYI item ?
- hopscc
- Posts: 632
- Location: New Plymouth, Taranaki, New Zealand
Re: static class problem
I'm not convinced it's needed. It's so easy to put "shared" on a line and put everything under it. And now that we can write "extend String ..." I'll never write another "class StringUtils" ever again. Goodbye procedural coding.
Anyone else have opinions on this?
Anyone else have opinions on this?
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: static class problem
Funny, I've made this mistake in the past too. It's probably C# syndrome where you can make a method and a class static with similar syntax.
My opinion would be to have this just to avoid an indentation level if you know the entire class is going to be static/shared. I know there are plans to have umbrella style private/protected like shared, which will be great because sometimes I don't like using underscores because it gets ugly after a while.
My opinion would be to have this just to avoid an indentation level if you know the entire class is going to be static/shared. I know there are plans to have umbrella style private/protected like shared, which will be great because sometimes I don't like using underscores because it gets ugly after a while.
- todd.a
- Site Admin
- Posts: 81
- Location: Chicago, IL
11 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 32 guests