Re: PyD - accessing D class fields in Python

2019-03-19 Thread Bastiaan Veelo via Digitalmars-d-learn
On Monday, 18 March 2019 at 22:25:10 UTC, clothlen wrote: Howdy; I'm trying to extend my Python program with D, but I'm having trouble accessing a D class's field/attribute/property/something. My D file looks like this: ``` module simpletest; import pyd.pyd; import std.stdio; class Example

Re: Compile-time associative array

2019-03-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/19/19 7:22 PM, Bastiaan Veelo wrote: Beware that a CT AA stores its elements in a different order than a RT AA, which you would notice in a foreach, for example. Yes, this is the issue -- the runtime AA depends on druntime, which is not available to the compiler. The compiler has its own

Re: Compile-time associative array

2019-03-19 Thread Bastiaan Veelo via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 08:50:15 UTC, boolangery wrote: Hi, I want to use a constant associative array in a ctfe-able function. Example: string ctfeableFunction() { return Foo["foo"]; } Then I force ctfe with: enum res = ctfeableFunction(); When I use an enum like: enum Foo = ["

Re: Emulating DLL

2019-03-19 Thread Craig via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 09:18:56 UTC, Kagamin wrote: There was this old project: http://dsource.org/projects/ddl/ Seems it is too heavily dependent on mago and has a lot of depreciated content. Probably not worth trying to update. Probably much easier just to hack dmd to export a simpler

Re: build 32-bit library on 64-bit OS

2019-03-19 Thread kinke via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 20:56:47 UTC, DFTW wrote: What package did you mean? that libphobos2 on the error messages from the ld? I'm using dmd/dub on Ubuntu 18. libphobos2-ldc-shared.so is definitely from LDC. I'll give a try to ldc, does it still is binary compatible with C? It's bett

Re: build 32-bit library on 64-bit OS

2019-03-19 Thread DFTW via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 20:31:46 UTC, kinke wrote: On Tuesday, 19 March 2019 at 17:23:21 UTC, DFTW wrote: /usr/bin/ld: skiping //usr/lib/x86_64-linux-gnu/libphobos2-ldc-shared.so incompatible to -lphobos2-ldc-shared /usr/bin/ld: couldn't find -lphobos2-ldc-shared If possible, use an off

Re: build 32-bit library on 64-bit OS

2019-03-19 Thread kinke via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 17:23:21 UTC, DFTW wrote: /usr/bin/ld: skiping //usr/lib/x86_64-linux-gnu/libphobos2-ldc-shared.so incompatible to -lphobos2-ldc-shared /usr/bin/ld: couldn't find -lphobos2-ldc-shared If possible, use an official package (https://github.com/ldc-developers/ldc/rel

Re: gtkD: How to paint to screen for animation

2019-03-19 Thread Michelle Long via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 19:03:37 UTC, Mike Wey wrote: On 19-03-2019 01:54, Michelle Long wrote: I've added a function to addOnDraw for a DrawingArea and it paints using the code I have when I resize. I added a queueDraw in threadsAddIdle and it seems to draws the screen immediately but i

Re: Emulating DLL

2019-03-19 Thread Craig via Digitalmars-d-learn
On Monday, 18 March 2019 at 22:59:12 UTC, Ethan Watson wrote: On Monday, 18 March 2019 at 22:50:57 UTC, Craig wrote: Is it possible to create a D module that has functions in it, and then use those functions dynamically at run time emulating DLL like functionality? On Monday, 18 March 2019 at

Re: Emulating DLL

2019-03-19 Thread Craig via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 09:18:56 UTC, Kagamin wrote: There was this old project: http://dsource.org/projects/ddl/ Thanks, looks pretty similar to what I was thinking. I'll have to mess with it a bit but maybe I can tweak any issues to suit my agenda.

Re: gtkD: How to paint to screen for animation

2019-03-19 Thread Mike Wey via Digitalmars-d-learn
On 19-03-2019 01:54, Michelle Long wrote: I've added a function to addOnDraw for a DrawingArea and it paints using the code I have when I resize. I added a queueDraw in threadsAddIdle and it seems to draws the screen immediately but it does not seem to be called again. If I put queueDraw ins

build 32-bit library on 64-bit OS

2019-03-19 Thread DFTW via Digitalmars-d-learn
So I need to build a 32-bit version of a library on 64-bit system. I got some errors, which I get rid of after installing the gcc 32-bit tools (and gcc -m32 ran fine) but I still get errors about libraries not compatible. the command: dub --arch=x86 yield erros such: /usr/bin/ld: skiping //

Re: gtkD: How to paint to screen for animation

2019-03-19 Thread Ron Tarrant via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 00:54:34 UTC, Michelle Long wrote: I've added a function to addOnDraw for a DrawingArea and it paints using the code I have when I resize. I added a queueDraw in threadsAddIdle and it seems to draws the screen immediately but it does not seem to be called again.

Re: File.lockingBinaryWriter is not output range?

2019-03-19 Thread Vladimir Panteleev via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 13:25:27 UTC, Denis Feklushkin wrote: On Tuesday, 19 March 2019 at 13:20:37 UTC, Vladimir Panteleev wrote: On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote: /+ dub.sdl: name "hello_world" +/ This doesn't seem necessary :) I add it ~everywhere fo

Re: File.lockingBinaryWriter is not output range?

2019-03-19 Thread Denis Feklushkin via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 13:20:37 UTC, Vladimir Panteleev wrote: On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote: /+ dub.sdl: name "hello_world" +/ This doesn't seem necessary :) I add it ~everywhere for faster reproducing of cases. static assert(isOutputRange!(type

Re: File.lockingBinaryWriter is not output range?

2019-03-19 Thread Vladimir Panteleev via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote: /+ dub.sdl: name "hello_world" +/ This doesn't seem necessary :) static assert(isOutputRange!(typeof(stdout.lockingBinaryWriter), byte)); static assert(isOutputRange!(typeof(stdout.lockingBinaryWriter()), byte)); typeof

Re: File.lockingBinaryWriter is not output range?

2019-03-19 Thread Denis Feklushkin via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote: stdout.lockingBinaryWriter.put(cast(byte) 123); // works // But this assert is false: static assert(isOutputRange!(typeof(stdout.lockingBinaryWriter), byte)); } Looks like isOutputRange is not checks "put" metho

File.lockingBinaryWriter is not output range?

2019-03-19 Thread Denis Feklushkin via Digitalmars-d-learn
/+ dub.sdl: name "hello_world" +/ import std.algorithm, std.range, std.stdio; void main() { // lockingBinaryWriter: Returns an output range that locks the file and allows fast writing to it. // https://dlang.org/library/std/stdio/file.locking_binary_writer.html stdout.lockingBina

Re: Another Tuesday (Friday?), Another GtkDcoding Blog Post

2019-03-19 Thread Ron Tarrant via Digitalmars-d-learn
Tuesday again. This blog post is about invisible Entry widgets and the FontButton. Really stimulating stuff and you'll find it at: http://gtkdcoding.com/2019/03/19/0019-disappearing-text-entry.html

Re: Emulating DLL

2019-03-19 Thread Kagamin via Digitalmars-d-learn
There was this old project: http://dsource.org/projects/ddl/

Re: Any easy way to extract files to memory buffer?

2019-03-19 Thread Patrick Schluter via Digitalmars-d-learn
On Monday, 18 March 2019 at 23:40:02 UTC, Michelle Long wrote: On Monday, 18 March 2019 at 23:01:27 UTC, H. S. Teoh wrote: On Mon, Mar 18, 2019 at 10:38:17PM +, Michelle Long via Digitalmars-d-learn wrote: On Monday, 18 March 2019 at 21:14:05 UTC, Vladimir Panteleev wrote: > On Monday, 18 M

Compile-time associative array

2019-03-19 Thread boolangery via Digitalmars-d-learn
Hi, I want to use a constant associative array in a ctfe-able function. Example: string ctfeableFunction() { return Foo["foo"]; } Then I force ctfe with: enum res = ctfeableFunction(); When I use an enum like: enum Foo = ["foo" : "bar"]; It works fine. D-Scanner keep saying to me: T

Re: dub getting stuck

2019-03-19 Thread Joel via Digitalmars-d-learn
On Monday, 18 March 2019 at 20:25:14 UTC, Joel wrote: On Sunday, 17 March 2019 at 09:04:37 UTC, Eugene Wissner wrote: On Sunday, 17 March 2019 at 07:20:47 UTC, Joel wrote: macOS 10.13.6 dmd 2.085.0 dub 1.3.0 [snip] dub 1.3.0 is something old. Is it reproducable with a newer version? Can

Re: is collectException working for every exceptions ?

2019-03-19 Thread Ali Çehreli via Digitalmars-d-learn
On 03/19/2019 12:00 AM, Roman Sztergbaum wrote: On Tuesday, 19 March 2019 at 00:07:44 UTC, Ali Çehreli wrote: On 03/18/2019 11:54 AM, Roman Sztergbaum wrote: > [...] with the > [...] Andre Pany has already explained. Otherwise, I was going to say "collectException can collect Exceptions, not e

Re: is collectException working for every exceptions ?

2019-03-19 Thread Roman Sztergbaum via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 00:07:44 UTC, Ali Çehreli wrote: On 03/18/2019 11:54 AM, Roman Sztergbaum wrote: > [...] with the > [...] Andre Pany has already explained. Otherwise, I was going to say "collectException can collect Exceptions, not exceptions." ;) [...] Hello, What happen if t