November 11, 2003 Re: stream operator suggestions BIG DAVE SHOUTOUT:D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Hauke Duden | problem is, that forces us, similar to c++, to write TWO stream operators every time, wich happen to be the same.. (thats why opCall is great.. its "bidirectional", or bether "nondirectional" :D) always overloading operator>> and operator<< is stupid, because there could be just one.. think of this: struct vec3 { float x,y,z; } vec3 operator~> { ~> x ~> y ~> z; } and we could write like this: vec3 v; inFile ~> v; and to store v ~> outFile; and infile on its own knows how to read in a float (wich could be stored binary, or textual, depending on the in-stream-type, of course).. and then, it would just read in 3 floats that way, and vec3 would be set. short, very simple, and very straightforward.. a stream class does then only have to be able to read in, or write out (or both:D) the basic types, and the rest is done like that. oh, and T[] operator ~> { this.length ~>; foreach(T component; this) { component ~>; } } would be the generic solution for an array.. so you can write out, and read in, those, too.. ack, we need bether templates.. template(T) T max(T a,T b) { return a > b ? a : b; } template(T) T[] operator ~> { length ~>; foreach(T o; this) o ~>; } so.. i think that was about that.. In article <bor47q$1ssg$1@digitaldaemon.com>, Hauke Duden says... > >davepermen wrote: >> i haven't written <-, but <~.. but its as ambiguous:D > >Whooops. Sorry ;) > >> i just don't like the way the non-ambiguous ones look like.. >> >> how about making it one direction only? > >You would have to read pull-lines from left to right and push-lines from right to left. That's inconsistent and burdensome to read. The right side might be scrolled out of the window for long lines, so you would only see a nonsensical chain of values, without knowing where they actually go. > >Naaah, I think we need two different operators. > >Hauke |
November 11, 2003 Re: stream operator suggestions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Roald Ribe | Roald Ribe wrote:
>~ is bad enough, on a Norwegian keyboard it is a dead key.
> (Alt Gr + ~) release (SPACE)
>
>° and µ does not even appear on my keyboard.
>
>§@# works. And can be displayed in 7-bit ASCII.
>Can ~ be displayed on 7-bit ASCII terminals? I doubt it.
>
>Roald
>
>
>
>
Why not just use a Norwegian symbol and run in through a simple preprocessor. Since D supports unicode, another option (I think this has been discussed before), is to have some support for aliasing symbols. Like either having a command for it (alias ~ to #), or a pluginable language module. But this can all be done with a pre-compiler anyways.
IMHO: There's always going to be some keyboard without the required keys (what about mobile phones and handled devices?).
|
November 11, 2003 Re: stream operator suggestions | ||||
---|---|---|---|---|
| ||||
Posted in reply to J Anderson | >IMHO: There's always going to be some keyboard without the required keys (what about mobile phones and handled devices?).
i feel good that i don't code yet on those while i'm bored... i feel sort of.. free:D
but yeah, ~ is not one key on my keyboard, but it is on it.. alt-gr and the one left of backspace.. so what? i'm trained to use it..
|
November 12, 2003 Re: stream operator suggestions | ||||
---|---|---|---|---|
| ||||
Posted in reply to davepermen | Perhaps we should post the symbols that we have on our keyboards and than we could the which everybody has. ^°!"§$%&/()=?²³{[]}\´`+*~#'-.:,;<>|@ (BTW: it's a german keyboard) |
November 12, 2003 Re: stream operator suggestions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Becker | In article <botkrj$2q4m$1@digitaldaemon.com>, Matthias Becker wrote: > Perhaps we should post the symbols that we have on our keyboards and than we could the which everybody has. Cool idea. I never knew that German keyboard had *those* keys... > ^°!"§$%&/()=?²³{[]}\´`+*~#'-.:,;<>|@ Remove °²³, add ½¨£¤ (which nobody really uses), and you have the Finnish/Swedish keyboard. The keys that are common for them are: ^!"§$%&/()=?`´+*~#'-.:,;<>|@ I think the US keyboard doesn't have § or ´ so we're left with: ^!"$%&/()=?`+*~#'-.:,;<>|@ Now what was the key missing from the Italian layout? ~? So there: ^!"$%&/()=?`+*#'-.:,;<>|@ -Antti |
November 13, 2003 Re: stream operator suggestions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Antti Sykäri | >Now what was the key missing from the Italian layout? ~? So there:
>
>^!"$%&/()=?`+*#'-.:,;<>|@
Oh, of courase I forgot the €. But I don't think any non-european country has this.
|
November 13, 2003 Re: stream operator suggestions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Becker | "Matthias Becker" <Matthias_member@pathlink.com> wrote in message news:bovl0i$2tc9$1@digitaldaemon.com... > >Now what was the key missing from the Italian layout? ~? So there: > > > >^!"$%&/()=?`+*#'-.:,;<>|@ > > > Oh, of courase I forgot the €. But I don't think any non-european country has > this. My Spanish keyboard has € (using AltGr+E) and I live in Colombia. Also, I've seen some US english keywords with it. |
November 13, 2003 Re: stream operator suggestions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Julio César Carrascal Urquijo | "Julio César Carrascal Urquijo" <adnoctum@phreaker.net> wrote in message news:bovveo$b9q$1@digitaldaemon.com... | | My Spanish keyboard has € (using AltGr+E) and I live in Colombia. Also, I've | seen some US english keywords with it. | So does mine (although I have it as latin american, so it doesn't work ;) ) ————————————————————————— Carlos Santander --- Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release Date: 2003-11-10 |
November 14, 2003 Re: stream operator suggestions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Antti Sykäri | In article <slrnbr56le.7v8.jsykari@pulu.hut.fi>, Antti =?iso-8859-1?Q?Syk=E4ri?= says... > [...] > >Now what was the key missing from the Italian layout? ~? So there: > >^!"$%&/()=?`+*#'-.:,;<>|@ The italian keyboard is missing also ` (the backquote : Alt-96), So there: ^!"$%&/()=?+*#'-.:,;<>|@ Ciao |
November 14, 2003 Re: stream operator suggestions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Becker | Matthias Becker wrote:
> Oh, of courase I forgot the €. But I don't think any non-european country has
> this.
It is unicode, so better not use it. Not everyone uses a unicode editor all the time.
Italian keyboard also lacks ` and some other keys. Really bad. :(
-eye
|
Copyright © 1999-2021 by the D Language Foundation