IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.43 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-08-10
[01:26]<cjmgrug>thats for c++ ^^^
[01:26]<sdnffdxdlld>yer I've gone and looked it up
[01:27]<cjmgrug>i find it similar to Using <namespace>.<namespace2>;
[01:27]<cjmgrug>using*
[01:27]<sdnffdxdlld>but I havent seen a truly useful practical use yet
[01:27]<sdnffdxdlld>you mean using Namespace = alias;?
[01:27]<cjmgrug>no..
[01:28]<sdnffdxdlld>that can be useful for stopping naming abiguities
[01:28]<sdnffdxdlld>typedef seems to give a type an alias
[01:28]<cjmgrug>the convenience you get from not typing looooooongnamespace.anotherlooooooooooongsnamespace.class a = new killme();
[01:29]<sdnffdxdlld>uhhh so instead of typing int you type MyTypeAlias? and thats shorter? :P
[01:30]<cjmgrug>if he declares a reference type of the type he wants to alias, wont that do the trick?
[01:30]<sdnffdxdlld>nahhh you cant do it in c# as far as i can see
[01:31]<sdnffdxdlld>you'd either have to use boxing or make a wrapper ... both of which has problems
[01:31]<kjr>he can just do a using as can't he
[01:31]<cjmgrug>lets say , a class IPAddress. and to make an alias, he could use IPAddress IP; and IP = new IPAddress( my args);
[01:31]<kjr>I know someone mentioned it above
[01:32]<cjmgrug>me :p
[01:32]<kjr>so in each class you do a using as
[01:32]<sdnffdxdlld>no, it wouldnt provide the functionality hes after
[01:32]<2jjnnz->using only works in a file scope, you can't have it in a class
[01:32]<zrrry>what are you trying to do?
[01:32]<kjr>boozer-: this is true
[01:32]<kjr>raggi: probably something completely insane
[01:32]<cjmgrug>whats a file scope?
[01:33]<sdnffdxdlld>he means class
[01:33]<kjr>CodeRun: it only works for that one class
[01:33]<kjr>I can see how to do it dynamically, but not at compiletime
[01:33]<kjr>although... C# does have a pre-processor
[01:34]<kjr>if the goal is just a shorter class name, then you've already spent more time than it'd be useful for...
[01:34]<cjmgrug>these C++ people want to bend c# to their c++ style :p
[01:34]<sdnffdxdlld>yer
[01:34]<kjr>using alias'ed types is also not really a clever idea in the long run
[01:34]<kjr>because you go to grep for something, but some jackass renamed it to something cutesy
[01:34]<sdnffdxdlld>the only useful place i can see for it is if you want to change the backing type sometime
[01:35]<sdnffdxdlld>but that would be more trouble than its wroth
[01:35]<kjr>smellyhippy: delegates?
[01:35]<zrrry>smellyhippy: delegate declarations can be outside the class iirc, and then they apply to the namespace, as with other non-members
[01:35]<kjr>raggi: pfft, too slow
[01:35]<pnfys>is it possible to listen for when the mouse enters a certain screen region in .NET?
[01:35]<zrrry>slow?!
[01:35]<cjmgrug>why create an alias? just rename your damn class, so that its not loooong anymore!
[01:35]<sdnffdxdlld>is that with reference to "file scope" ?
[01:36]<zrrry>yes
[01:36]<2jjnnz->CodeRun what makes you think it's my class
[01:36]<kjr>CodeRun: I actually see no real good reason to do it
[01:36]<kjr>CodeRun: it sounds like a hackish idea that will get someone in trouble
[01:36]<kjr>CodeRun: unless the class name was in german and happened to be about 1024 characters long
[01:36]<sdnffdxdlld>well yeah there are things you can define out side of a class but they fall under the namespace scop dont they ... rather than the file
[01:36]<cjmgrug>heh
[01:36]<2jjnnz->class indirection is a good idea. you can change the class used while keeping the same interface
[01:36]<rxrcr>you said the magic word
[01:36]<zrrry>Kog: or your IDE doesn't support unicode source files or some other roflsome idea
[01:37]<rxrcr>use an interface for indrection
[01:37]<kjr>raggi: no, I say German because they compose words in a particular fashion: compound
[01:37]<zrrry>smellyhippy: fair point.
[01:37]<kjr>raggi: as opposed to latin languages, which do multi-word adjectivized versions
[01:37]<kjr>whoops, Adjectival
[01:37]<zrrry>Kog: actually, in english we use the same words, we just foolishly put commonly unparsable spaces between them :-P
[01:38]<sdnffdxdlld>yeah interfaces are a better solution as you know changing the backing type wont break the functionality
[01:38]<cjmgrug>how about creating a new class and using composition, including a reference variable to an instance of the longNamed class
[01:38]<kjr>raggi: English isn't quite as Germanic as it could be
[01:38]<kjr>CodeRun: or using a manager/abitrator
[01:38]<cjmgrug>wtf are those things, Kog?
[01:38]<kjr>there are actually a handful of patterns that'll do what boozer- wants
[01:38]<cjmgrug>design patterns?
[01:39]<sdnffdxdlld>CodeRun: something that will act as a go between
[01:39]<zrrry>surely the reflection api has something which can do this, if i have the right idea of what he wants
[01:39]<kjr>no, Jacquard Loom patterns
[01:39]<cjmgrug>lol
[01:39]<kjr>Ada will be by later to pick up her order of custom rugs...
[01:39]<zrrry>is he wanting to rename a class or create a struct or what?
[01:39]<sdnffdxdlld>yeah it can be done in reflection but only dynamically and it'd be slower than doing it the c# way
[01:39]<kjr>smellyhippy: manager object!
[01:40]<cjmgrug>everyones just trying to guess the problem and find a solution :p
[01:40]<sdnffdxdlld>kog: still overkill
[01:40]<kjr>depends on the scope of the system
[01:40]<sdnffdxdlld>true, true
[01:40]<kjr>something tells me that if boozer- has any sense, he's not doing this for a 15 line PoC app
[01:40]<zrrry>smellyhippy: renaming the symbols once won't be that slow m8
[01:40]<2jjnnz->MyClass.NativeInt . NativeInt would be int32 on 32 bit machines, 64 on 64bit. this is not what I'm doing but it gives you an idea
[01:40]<2jjnnz->I don't see a way to do that in C#
[01:41]<kjr>that's because you're used to using a dirty hack instead of a design feature
[01:41]<cjmgrug>http://en.wikipedia.org/wiki/Jacquard_loom
[01:41]<kjr>which is the inate issue with doing such hacks
[01:41]<zrrry>boozer-: why would you want to do that?
[01:41]<kjr>CodeRun: did I mispell it?
[01:41]<cjmgrug>no
[01:41]<cjmgrug>i just wanted others to know, how great your thought pattern is.
[01:41]<cjmgrug>:p
[01:41]<2jjnnz->Kog seems to me like I have to resort to dirty hacks to simulate that
[01:41]<kjr>boozer-: using typedef is a lazy hack
[01:41]<myv_mjjgq>hi guys! I have a Q1! How to convert IL to .asm file?
[01:41]<sdnffdxdlld>boozer-: you have to use dirty hacks to emulate a dirty hack? :P
[01:42]<kjr>boozer-: whereas a manager object isn't a dirty hack
[01:42]<zrrry>boozer-: that seems a bit silly in most cases - unless you have code for all teh meta properties of specific sized int's (in which case you seperate the code and launch by finding out the machine property) then you'd be running into potential overflow/underflow issues.
[01:42]<kjr>boozer-: it may be over engineering, but it isn't a hack
[01:42]<kjr>unless you happen to be Slava
[01:42]<2jjnnz->Kog yeah god forbid for you to use a simple type alias for a type alias
[01:42]<kjr>in which case it's a dirty hack because of the inability of the language







