Thread overview
Ported PDCurses
Mar 14, 2005
Joey Peters
Mar 16, 2005
Niall FitzGibbon
Mar 17, 2005
Joey Peters
Mar 17, 2005
Niall FitzGibbon
Jun 09, 2006
myemail
Jun 09, 2006
myemail
March 14, 2005
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.



March 16, 2005
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 :)
March 17, 2005
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 :)


March 17, 2005
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 :) 
> 
> 
> 
June 09, 2006
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.


June 09, 2006
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.