www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Ported PDCurses

reply "Joey Peters" <squirrel nidhogg.com> writes:
I ported PDCurses to D. This is the first time ever I ported something, so 
sorry if things are a bit unwieldy or ugly.

Example:

import curses;
int main(char[][] args) {
  initscr();
  for(int x = 0; x < 10; x++) {
    flash();
  }
  return 0;
}

Haven't played with it a lot yet. I hope I can code my roguelike with this 
:) Enjoy. 
Mar 14 2005
parent reply Niall FitzGibbon <billdoor gmail.com> writes:
Joey Peters wrote:
 I ported PDCurses to D. This is the first time ever I ported something, so 
 sorry if things are a bit unwieldy or ugly.
 
 Example:
 
 import curses;
 int main(char[][] args) {
   initscr();
   for(int x = 0; x < 10; x++) {
     flash();
   }
   return 0;
 }
 
 Haven't played with it a lot yet. I hope I can code my roguelike with this 
 :) Enjoy. 
 
 

Thanks for this port. However, I get the following errors when trying to build with DMD 1.18 on Windows: C:\dmd\src>dmd curses.d curses.d(14): non-constant expression *(&Mouse_status) curses.d(15): non-constant expression *((&Mouse_status+4)) curses.d(16): non-constant expression *((&Mouse_status+16)) & 7 curses.d(17): non-constant expression *((&Mouse_status+16)) & 8 curses.d(18): non-constant expression *((&Mouse_status+16)) & 16 I worked through this by commenting out the code (I don't need mouse support in my app) but could you tell me what version of DMD you managed to compile it with? Thanks :)
Mar 16 2005
parent reply "Joey Peters" <squirrel nidhogg.com> writes:
Strangely enough it just happily compiles for me in the latest version, 
1.18. Or well, I didn't compile it, I just included it (since it's just a 
bunch of C imports).

Also note that there are some functions that are actually macros, I didn't 
port those, that would require me to insert those functions back in the lib 
again and do all that boring work. I didn't realise porting can be such a 
pain sometimes.

"Niall FitzGibbon" <billdoor gmail.com> schreef in bericht 
news:d1a6f4$23r8$1 digitaldaemon.com...
 Joey Peters wrote:
 I ported PDCurses to D. This is the first time ever I ported something, 
 so sorry if things are a bit unwieldy or ugly.

 Example:

 import curses;
 int main(char[][] args) {
   initscr();
   for(int x = 0; x < 10; x++) {
     flash();
   }
   return 0;
 }

 Haven't played with it a lot yet. I hope I can code my roguelike with 
 this :) Enjoy.

Thanks for this port. However, I get the following errors when trying to build with DMD 1.18 on Windows: C:\dmd\src>dmd curses.d curses.d(14): non-constant expression *(&Mouse_status) curses.d(15): non-constant expression *((&Mouse_status+4)) curses.d(16): non-constant expression *((&Mouse_status+16)) & 7 curses.d(17): non-constant expression *((&Mouse_status+16)) & 8 curses.d(18): non-constant expression *((&Mouse_status+16)) & 16 I worked through this by commenting out the code (I don't need mouse support in my app) but could you tell me what version of DMD you managed to compile it with? Thanks :)

Mar 17 2005
parent reply Niall FitzGibbon <billdoor gmail.com> writes:
How odd.  While compilations works for me now in 1.18 I also get some 
linker errors.  Since it works fine for you, it's probably just a 
problem with my DMD setup.  Thanks anyway :)

Joey Peters wrote:
 Strangely enough it just happily compiles for me in the latest version, 
 1.18. Or well, I didn't compile it, I just included it (since it's just a 
 bunch of C imports).
 
 Also note that there are some functions that are actually macros, I didn't 
 port those, that would require me to insert those functions back in the lib 
 again and do all that boring work. I didn't realise porting can be such a 
 pain sometimes.
 
 "Niall FitzGibbon" <billdoor gmail.com> schreef in bericht 
 news:d1a6f4$23r8$1 digitaldaemon.com...
 
Joey Peters wrote:

I ported PDCurses to D. This is the first time ever I ported something, 
so sorry if things are a bit unwieldy or ugly.

Example:

import curses;
int main(char[][] args) {
  initscr();
  for(int x = 0; x < 10; x++) {
    flash();
  }
  return 0;
}

Haven't played with it a lot yet. I hope I can code my roguelike with 
this :) Enjoy.

Thanks for this port. However, I get the following errors when trying to build with DMD 1.18 on Windows: C:\dmd\src>dmd curses.d curses.d(14): non-constant expression *(&Mouse_status) curses.d(15): non-constant expression *((&Mouse_status+4)) curses.d(16): non-constant expression *((&Mouse_status+16)) & 7 curses.d(17): non-constant expression *((&Mouse_status+16)) & 8 curses.d(18): non-constant expression *((&Mouse_status+16)) & 16 I worked through this by commenting out the code (I don't need mouse support in my app) but could you tell me what version of DMD you managed to compile it with? Thanks :)


Mar 17 2005
next sibling parent myemail somewhere.com writes:
In article <d1cdd4$1cdn$1 digitaldaemon.com>, Niall FitzGibbon says...
How odd.  While compilations works for me now in 1.18 I also get some 
linker errors.  Since it works fine for you, it's probably just a 
problem with my DMD setup.  Thanks anyway :)

Joey Peters wrote:
 Strangely enough it just happily compiles for me in the latest version, 
 1.18. Or well, I didn't compile it, I just included it (since it's just a 
 bunch of C imports).
 
 Also note that there are some functions that are actually macros, I didn't 
 port those, that would require me to insert those functions back in the lib 
 again and do all that boring work. I didn't realise porting can be such a 
 pain sometimes.
 
 "Niall FitzGibbon" <billdoor gmail.com> schreef in bericht 
 news:d1a6f4$23r8$1 digitaldaemon.com...
 
Joey Peters wrote:

I ported PDCurses to D. This is the first time ever I ported something, 
so sorry if things are a bit unwieldy or ugly.

Example:

import curses;
int main(char[][] args) {
  initscr();
  for(int x = 0; x < 10; x++) {
    flash();
  }
  return 0;
}

Haven't played with it a lot yet. I hope I can code my roguelike with 
this :) Enjoy.

Thanks for this port. However, I get the following errors when trying to build with DMD 1.18 on Windows: C:\dmd\src>dmd curses.d curses.d(14): non-constant expression *(&Mouse_status) curses.d(15): non-constant expression *((&Mouse_status+4)) curses.d(16): non-constant expression *((&Mouse_status+16)) & 7 curses.d(17): non-constant expression *((&Mouse_status+16)) & 8 curses.d(18): non-constant expression *((&Mouse_status+16)) & 16 I worked through this by commenting out the code (I don't need mouse support in my app) but could you tell me what version of DMD you managed to compile it with? Thanks :)



I've just started to code a roguelike, and i noticed the same errors with the mouse functions, but only when using build.exe , not a straight compile with dmd.exe! hope this helps someone out, as i'm not up to the job of fixing it myself (yet), as i'm a D newbie.
Jun 09 2006
prev sibling parent myemail somewhere.com writes:
In article <d1cdd4$1cdn$1 digitaldaemon.com>, Niall FitzGibbon says...
How odd.  While compilations works for me now in 1.18 I also get some 
linker errors.  Since it works fine for you, it's probably just a 
problem with my DMD setup.  Thanks anyway :)

Joey Peters wrote:
 Strangely enough it just happily compiles for me in the latest version, 
 1.18. Or well, I didn't compile it, I just included it (since it's just a 
 bunch of C imports).
 
 Also note that there are some functions that are actually macros, I didn't 
 port those, that would require me to insert those functions back in the lib 
 again and do all that boring work. I didn't realise porting can be such a 
 pain sometimes.
 
 "Niall FitzGibbon" <billdoor gmail.com> schreef in bericht 
 news:d1a6f4$23r8$1 digitaldaemon.com...
 
Joey Peters wrote:

I ported PDCurses to D. This is the first time ever I ported something, 
so sorry if things are a bit unwieldy or ugly.

Example:

import curses;
int main(char[][] args) {
  initscr();
  for(int x = 0; x < 10; x++) {
    flash();
  }
  return 0;
}

Haven't played with it a lot yet. I hope I can code my roguelike with 
this :) Enjoy.

Thanks for this port. However, I get the following errors when trying to build with DMD 1.18 on Windows: C:\dmd\src>dmd curses.d curses.d(14): non-constant expression *(&Mouse_status) curses.d(15): non-constant expression *((&Mouse_status+4)) curses.d(16): non-constant expression *((&Mouse_status+16)) & 7 curses.d(17): non-constant expression *((&Mouse_status+16)) & 8 curses.d(18): non-constant expression *((&Mouse_status+16)) & 16 I worked through this by commenting out the code (I don't need mouse support in my app) but could you tell me what version of DMD you managed to compile it with? Thanks :)



I've just started to code a roguelike, and i noticed the same errors with the mouse functions, but only when using build.exe , not a straight compile with dmd.exe! hope this helps someone out, as i'm not up to the job of fixing it myself (yet), as i'm a D newbie.
Jun 09 2006