March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sigbjørn Lund Olsen | At times like these, EditPlus is your friend. :) Or any other editor that will highlight embedded PHP. (I don't plug EditPlus enough...)
-C. Sauls
-Invironz
> Hmm. FYI, and because I'm waiting for my downloads to end (never happens). The most annoying syntax error I tend to make is when I forget to close a literal string somewhere. Mind, I only do this when I use PHP - never had this problem elsewhere, probably because I use less literal strings elsewhere. At any rate, while PHP tends to output fairly good error messages (certainly better than any other "compiler" I've ever used including dmd at the moment, but hopefully not forever(?)) in this case it just cannot figure out the whereabouts of the error, so I usually end up checking ever singly literal string I've written. (I should really run scripts/compile a lot more often, it's a bad habit of mine to write 200-400 lines and *then* sort out all the errors, just to finally find that the logic is broken, and then I can't find it.)
|
March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | Ant wrote:
> On Wed, 10 Mar 2004 16:11:01 +0100, Sigbjørn Lund Olsen wrote:
>
>
>>The most annoying syntax error I tend to make is when I forget to close a literal string somewhere.
>
>
> (Ah! another opportunity to talk about leds.)
>
> leds will highlight unclosed literals with a different color.
> (This is standard on Scintilla)
>
> Ant
>
What do you think about some basic features for leds:
-Class navigator (like in Delphi or python IDE)
-Antialias fonts (leds is scintilla based...)
-Differents encodings (UTF8.... I can't write some spanish characters in leds)
...
Now I'm using SciTE for editing D files in linux, because leds is at an earlier stage, but I hope leds will be a standard tool for D programming
Julio
|
March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to J Anderson | J Anderson wrote:
> J Anderson wrote:
>
>> imr1984 wrote:
>>
>>> I think statements should be seperated by new lines OR semicolons, so that
>>> existing D code will still work.
>>>
>>>
>> I agree, although I'd still like to use semicolons now-and-then, having them optional would be great.
>>
> I would also: add that semicolons are just another small redundancy (most of the time) for the programmer. Removing redundancies makes code just a little bit easier for coders.
>
Do note, however, that removing reduncancies also increases the probability that a random change won't be detected as an error. A part of the art of language design is deciding on the correct amount of reduncancy. In this case Walter decided on a choice that made things easy for the parser. Many of his choices were made on those grounds. D is intended to be parseable purely syntactically, without the need for any semantic knowledge, or any non-local knowledge, e.g.
|
March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to imr1984 | imr1984 wrote: > the other day i was studying assembly programming, and it struck me - why does D > need semicolons after statements at all? they seem like a waste of time. > > I think statements should be seperated by new lines OR semicolons, so that > existing D code will still work. Not necessarily: qwert = yuiop (asdfg()) would change its meaning from qwert = yuiop(asdfg()); to qwert = yuiop; asdfg(); > Ive been programming C style languages for years now and i still often forget a > semicolon - so i think this would be a big time saver, I think the time spent by the rest of us somehow resolving the resulting ambiguities/syntax errors/bugs would outweigh the benefits. > as well as making the code more readable How, exactly? Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit. |
March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Julio Jiménez | On Wed, 10 Mar 2004 17:08:21 +0100, Julio Jiménez wrote: > Ant wrote: >> (Ah! another opportunity to talk about leds.) > > What do you think about some basic features for leds: > -Class navigator (like in Delphi or python IDE) Like eclipse class hierarchy? or a complete hierarchy? I thing a simple parent hierarchy could be usefull and simple to implement. what do you mean? a full classes relation diagram? (that might not happed soon but should be fun to do I can imagine a full OpenGL navigation ;) > -Antialias fonts (leds is scintilla based...) from Scintilla docs: "On GTK+ 2.x, either GDK or Pango can be used to display text. Pango antialiases text and works well with Unicode but GDK is faster. Prepend a '!' character to the font name to use Pango." so when leds allows you to select the font that should be covered. > -Differents encodings (UTF8.... I can't write some spanish characters in leds) from scintilla: SCI_SETCODEPAGE(int codePage) SCI_GETCODEPAGE but I no nothing about UTF how do you know the codePage number? I'm going to try to add that option right now. > ... > > Now I'm using SciTE for editing D files in linux, because leds is at an earlier stage, but I hope leds will be a standard tool for D programming > Since I remove the background (separate thread) compile and execute leds is uncrashable (yea, sure), except for the combo boxes. I need to reread the GTK threads docs. :( I need to fix the combo boxes. :( leds has only 3 combos I'll change that to entries (text fields), add the code page (help me here with the code numbers), (maybe not) allow to select the fonts and release it in a couple of days. try leds in a few days after the next release announcement. Ant |
March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to imr1984 | <snip> In article <c2n4fj$lva$1@digitaldaemon.com>, imr1984 says... >Ive been programming C style languages for years now and i still often forget a semicolon - so i think this would be a big time saver, as well as making the code more readable </snip> How can one keystroke in fifty be a big time saver? I still spend much more time typing SPACEs for my indents (still trying to remember to use TAB now that I use editors that will insert SPACEs). I like the semi-colons, especially when several statements are on one line (yuck). Is: x = y f(z) two statements? Or did I forget an operator? If I missed an operator I want the compiler to tell me something's wrong, rather than hum happily along. And wouldn't the time spent finding such a bug far outweigh any potential time saving from not typing that one simple character? The first programming language I learned was BASIC Plus on a PDP-11, it allowed a colon to separate multiple statements on a line, so the above could be unambiguous as: x = y : f(z) (I used to see how few lines I could use for my programs, now I've learned to use as many lines for one statement as possible, especially for .net) |
March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juan C | Juan C wrote: <snip> > How can one keystroke in fifty be a big time saver? I still spend much more time > typing SPACEs for my indents (still trying to remember to use TAB now that I use > editors that will insert SPACEs). What have you against TABs? <snip> > x = y f(z) > > two statements? Or did I forget an operator? <snip> > The first programming language I learned was BASIC Plus on a PDP-11, it allowed > a colon to separate multiple statements on a line, So does nearly every BASIC dialect ever invented. > so the above could be unambiguous as: > > x = y : f(z) <snip> But probably not what the programmer intended. Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit. |
March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | Ant wrote: > On Wed, 10 Mar 2004 17:08:21 +0100, Julio Jiménez wrote: > > >>Ant wrote: >> >>>(Ah! another opportunity to talk about leds.) >> >>What do you think about some basic features for leds: >>-Class navigator (like in Delphi or python IDE) > > > Like eclipse class hierarchy? > or a complete hierarchy? > Really a complete code navigation in a Tree view you can put all the classes and functions of the active file (d file) you can expand the tree and see all the class members (grouped by visibility... public, private....) double clicking in the tree the current cursor position at the code will be moved member or function you selected. In this way, you can see al the members class easily and navigate throw the code. I don't know about eclipse but Borland Delphi and python IDE have something there. The code navigator is really usefull to remember all the functions in a file and all the members for one class > I thing a simple parent hierarchy could be usefull > and simple to implement. > > what do you mean? a full classes relation diagram? > (that might not happed soon but should be fun to do > I can imagine a full OpenGL navigation ;) > > Really full code navigation and one option to open an imported file.... ;) >>-Antialias fonts (leds is scintilla based...) > > > from Scintilla docs: > "On GTK+ 2.x, either GDK or Pango can be used to display text. > Pango antialiases text and works well with Unicode but GDK is faster. > Prepend a '!' character to the font name to use Pango." > > so when leds allows you to select the font that should be covered. > Ok. really for text editing no need a great speed but the visual aspect is better for antialiases fonts > >>-Differents encodings (UTF8.... I can't write some spanish characters in leds) > > > from scintilla: > SCI_SETCODEPAGE(int codePage) > SCI_GETCODEPAGE > > but I no nothing about UTF how do you know the codePage number? > I'm going to try to add that option right now. > > You can select the encoding you want for the editor.... from SciTE you can select File->Encoding... and select 8 bits, UTF-8..... Gtk2 uses UTF8 so i use UTF8 for my file encodings (no translating strings) No need to know codepage.... is character encoding and you can select those you want >>... >> >>Now I'm using SciTE for editing D files in linux, because leds is at an earlier stage, but I hope leds will be a standard tool for D programming >> > > > Since I remove the background (separate thread) compile and execute > leds is uncrashable (yea, sure), except for the combo boxes. > I need to reread the GTK threads docs. :( > I need to fix the combo boxes. :( > Not only combo..... From DUI TEditableCells.d file // columns ~= DUIType.INT; // columns ~= DUIType.STRING; // columns ~= DUIType.BOOLEAN; columns ~= DUIType.STRING; columns ~= DUIType.STRING; columns ~= DUIType.BOOLEAN; strange results DUIType.INT is broken.... I get strange results in the Treeviewcolumn...... visual representation for integers converted to strings is bad.... in the window but the stdout is correct i can red in the terminal screen: 3 bottles of coke true 5 packages of noodles true 2 packages of chocolate chip cookies true 1 can vanilla ice cream true 6 eggs true but in the Editable cell example window: 3456789 bottles of coke 56789 packages of noodles 23456789 packages of chocolate chip cookies 123456789 can vanilla ice cream 6789 eggs funny... :) when i add items clicking button all is ok..... in window and console there is something wrong in ListRow.... > leds has only 3 combos I'll change that to entries (text fields), > add the code page (help me here with the code numbers), > (maybe not) allow to select the fonts > and release it in a couple of days. > > try leds in a few days after the next release announcement. > > Ant > All right... waiting now i'm working in my PostgreSQL >= 7.4 D interface ..... ;) can write programs in C stlye.... ... /* Make a connection to the database */ conn = PQconnectdb(conninfo); if (PQstatus(conn) != ConnStatusType.CONNECTION_OK) { printf("Connection to database '%s' failed.\n", PQdb(conn)); printf("%s", PQerrorMessage(conn)); exit_nicely(conn); } /* Start a transaction block */ res = PQexec(conn, "BEGIN"); if (PQresultStatus(res) != ExecStatusType.PGRES_COMMAND_OK) { printf("BEGIN command failed: %s", PQerrorMessage(conn)); PQclear(res); exit_nicely(conn); } ... and using D classes..... import dlibpq.connection; import dlibpq.transaction; import dlibpq.result; int main(char[][] args) { Connection C = new Connection("dbname = julio"); // can use Connection C = new Connection() for defaults if (!C.connected()) { printf("No pude conectar a la base de datos julio...\n"); return 1; } Transaction T = new Transaction(C, "tra1"); Result R = T.exec("create table ciudades (nombre varchar(80), poblacion int)"); if (!R.commandOk) { printf("error creando tabla: %.*s\n", R.errorMessage()); T.rollBack(); } else T.commit(); delete R; T.begin(); char [] sql = "insert into ciudades values ('Trujillo', 10000);"; sql ~= "insert into ciudades values ('Huertas', 3000);"; sql ~= "insert into ciudades values ('Madrid', 5000000);"; R = T.exec(sql); if (!R.commandOk) { printf("error insertando registros: %.*s\n", R.errorMessage()); T.rollBack(); } else T.commit(); return 0; } regards, Julio |
March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Julio Jiménez | On Wed, 10 Mar 2004 19:20:21 +0100, Julio Jiménez wrote: > Really a complete code navigation > in a Tree view you can put all the classes and functions of the active > file (d file) > you can expand the tree and see all the class members (grouped by > visibility... public, private....) > double clicking in the tree the current cursor position at the code will > be moved member or function you selected. that's doable. leds already shows you the members for and opened module (kind of alpha quality but I'm looking at it). later I don't really fill the need for it. You know that you can select any variable on leds and open the module that defines it's type, right? (again, kind of alpha quality but I'm looking at it) > Ok. really for text editing no need a great speed but the visual aspect is better for antialiases fonts done! already I can feel that the page down/page up it's a bit slower. of course the non anti-aliasing is still available it's interesting how pango and gtk do the size differently... > > Gtk2 uses UTF8 so i use UTF8 for my file encodings (no translating strings) No need to know codepage.... is character encoding and you can select those you want done! things happen on my system but I don't realy know how to test. > Not only combo..... yes, I was talking about leds. I have I major problem on DUI: accessing the C structs directly combo needs it, values for TreeView (tables and trees) needs it... (combo doesn't work at all on the windows version) (I'll keep this bookmarked, thanks) > > All right... waiting :) > > now i'm working in my PostgreSQL >= 7.4 D interface ..... ;) you know about my dpq, right? http://dpq.sourceforge.net (will redirect to the old page) that project is on hold because I don't need a DB right now, but when I do I think I'm gonna look into ODBC for PostgreSQL. Ant |
March 10, 2004 Re: suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | Ant wrote: > On Wed, 10 Mar 2004 19:20:21 +0100, Julio Jiménez wrote: > > >>Really a complete code navigation >>in a Tree view you can put all the classes and functions of the active file (d file) >>you can expand the tree and see all the class members (grouped by visibility... public, private....) >>double clicking in the tree the current cursor position at the code will be moved member or function you selected. > > > that's doable. leds already shows you the members for > and opened module (kind of alpha quality but I'm looking at it). > later I don't really fill the need for it. > You know that you can select any variable on leds and open > the module that defines it's type, right? as you said... in alpha quality... :) but it's the beginning some things in leds don't run fine for me may be because i'm using the binary package.... When i try to create a new project, i get a messagedialog with: Unable to load project definition for project. :( then i can write the specs for the project and compile and make.... but can't save the project itself... so i have to create the project again when i run leds.... :( > (again, kind of alpha quality but I'm looking at it) > > > >>Ok. really for text editing no need a great speed but the visual aspect is better for antialiases fonts > > > done! > already I can feel that the page down/page up it's a bit slower. > of course the non anti-aliasing is still available > it's interesting how pango and gtk do the size differently... > I can't fell the difference comparing leds and SciTE (may be computer speed.... don't know) it's quick for both > >>Gtk2 uses UTF8 so i use UTF8 for my file encodings (no translating strings) >>No need to know codepage.... is character encoding and you can select those you want > > > done! > things happen on my system but I don't realy know how to test. > > >>Not only combo..... > > yes, I was talking about leds. > I have I major problem on DUI: > accessing the C structs directly > combo needs it, values for TreeView (tables and trees) needs it... > (combo doesn't work at all on the windows version) > > (I'll keep this bookmarked, thanks) > >>All right... waiting > > > :) > > >>now i'm working in my PostgreSQL >= 7.4 D interface ..... ;) > > > you know about my dpq, right? > Yes. i changed some code to run in PostgreSQL 7.4.1 but you need a lot of code for communicating and sending comands to backend.... and some bugs..... :) every time you execute.... result = exec.exec("FETCH ALL in mycursor"); create a new DPQResult object... (returned by exec.exec....) then you execute result.clear(); for clear the PGresult* but the created DPQResult still alive.... then you execute again... result = exec.exec(........ and get a stack of unused objects..... that's because i wrote a new client interface for my own use (but i'll do it public when i finish it) I have writen it using another concept.... near libpqxx (c++ client interface) but more basic and easy to use, (transactions based). The blocking mode is running ok.... now i'm writing the non blocking mode code > http://dpq.sourceforge.net (will redirect to the old page) > > that project is on hold because I don't need a DB right now, > but when I do I think I'm gonna look into ODBC for PostgreSQL. > PostgreSQL provides a type 4 JDBC driver. Type 4 indicates that the driver is written in Pure Java, and communicates in the database system's own network protocol. Because of this, the driver is platform independent; once compiled, the driver can be used on any system. A model for D implementation. > Ant > I'll wait for your new leds version for test it, and if i could help to you, i'll do it. Thanks for your great work. Regards Julio |
Copyright © 1999-2021 by the D Language Foundation