On Wednesday, 26 September 2012 at 17:57:29 UTC, Andrei
Alexandrescu wrote:
Haven't done any dynamic linking with D and I need to. I'm
using dmd 2.058/Linux at work to build and use dynamic
libraries. Here's my attempt:
Maybe it will help you
D:
https://bitbucket.org/AnyCPU/codewithd/raw/de0a2
Also, I want to add that type declarations should be changed
from statements to expressions so that we could do:
auto tup = (3, "hello");
(int num, string s) = tup; // num == 3, s == "hello"
+1.
or
int num;
string s;
auto tup = (3, "hello");
(num, s) = tup;
or like x++ containers
http://ms
On Tuesday, 25 September 2012 at 17:13:44 UTC, Denis Shelomovskij
wrote:
.NET has FlagsAttribute, Java has EnumSet. Looks like we need
this too. How about to add a library solution to Phobos?
+1.
Also I'm not sure:
* Should we support converting from a number to a flag enum?
+1.
* If so,
Thanks. The loading part is very useful, but I'm still lost
when it comes to build the shared library itself.
Andrei
Program loads dll at runtime using loader which is configured to
load concrete dll file(s). Like in gtkD
http://www.dsource.org/projects/gtkd/browser/trunk/src/gtkc/Loader.d
Loading Shared lib isn't big issues here.
The bigger one is building Shared library (written in D) and
running it in host application without issues (EH, shared GC
etc).
Andrei, if you find out how to make those things work, please
share your findings. I'm also in need of using shared librar
On Saturday, 15 September 2012 at 12:38:53 UTC, Henning Pohl
wrote:
The way D is dealing with classes reminds me of pointers
because you can null them. C++'s references cannot (of course
you can do some nasty casting). So you can be sure to have a
valid well-defined object. But then there is al
On Sunday, 23 September 2012 at 20:39:38 UTC, Andrei Alexandrescu
wrote:
I discussed this with Walter, and we concluded that we could
deprecate the comma operator if it helps tuples. So I started
with this:
http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP19
Unfortunately, I start
I can't compile even hello world on both Win 7 and Win XP.
rust 0.4, latest mingw.
The announcement seems to suggest you might need an older mingw:
https://mail.mozilla.org/pipermail/rust-dev/2012-October/002489.html
Also if you had 0.3 you need to uninstall it before installing
0.4.
Yes. I read it. It is annoying.
If it possible maybe some info can be taken from mono project?
void f()
{
writeln("hi");
}
f; // this currently works
I don't know if this is possible to implement.
I expect it is, perhaps by disallowing calling a property
function with no arguments.
It's regular function called as property [getter] of module.
It's nice to have @property like in C
void f()
{
writeln("hi");
}
f; // this currently works
I don't know if this is possible to implement.
I expect it is, perhaps by disallowing calling a property
function with no arguments.
It's regular function called as property [getter] of module.
It's nice to have @property like in C
Machine/hardware have a explicitly defined register size and does
know nothing about sign and data type. fastest operation is
unsigned and fits to register size.
For example in your case, some algorithm that coded with
chained-if-checks may come unusable because it will slow.
And about C# ch
And about C# checked:
http://msdn.microsoft.com/ru-ru/library/74b4xzyw.aspx
By default it is only for constants. For expressions in runtime
it must be explicitly enabled.
en link: http://msdn.microsoft.com/en-us/library/74b4xzyw.aspx
I read all thread and conclude that developers want a one button
- 'do all what I need'.
As mentioned above, for example, python have a arbitrary int
(that implemented as C library ;)).
C can be used on many platforms. For each platform developer have
solution as library. Right way is creati
Thread (and etc) is a high level abstraction that requires a
support by hardware/software/instruction set. If it necessary,
library can be integrated to language. And it's another one
question about design.
Even OOP possible in asm.
It's completely OT ;)
dmd ./main.d -debug -profile -w -v -g -cov -gs
// version v2.060
Reproducible.
dmd ./main.d -release -noboundscheck -O
// version v2.060
Irreproducible.
Win 8 x64, dmd x32.
R With(I, R)(I o, R function (I) fun)
{
static if(isAssignable!(I, typeof(null)))
return o is null ? null : fun(o);
else
return fun(o);
}
class Person
{
private
{
string _name;
Address _address;
Thanks guys)
auto With(alias fun, I)(I o) // maybe add a template constraint
here
{
static if(isAssignable!(I, typeof(null)))
return o is null ? null : fun(o);
else
return fun(o);
}
foreach(p; persons)
p.With!(x => x.address);
Now i
Windows have NuGet for Visual Studio or console client.
It is difficult to create package for each OS. In this case we
need a script that make a package for each OS or a one maintainer.
Or we need a one tool(script written in D) for the D (I mean D -
the D Platform) and website with list of p
I just doing a chained null checks.
And I prefer when code looks like "a => ...".
In any case we have two ways to do same thing: "a => {...}()" and
"(a){...}".
Thanks Timon)
Hi everyone)
dmd 2.058
os: win 7 64 bit
fortran compilers: gfortran, ftn95
I have a fortran code that compiled into dll:
SUBROUTINE fsu (i)
real :: x
integer :: i
x = 0.025
print *, 'The answer is x = ', x , i
END SUBROUTINE fsu
and simple D code
import std.stdio;
import core.
Maybe
[x, y] = func();
?
On Tuesday, 13 March 2012 at 22:30:02 UTC, Tobias Brandt wrote:
Fortran uses pass-by-ref by default. You could try
integer, value :: i
in the Fortran function declaration, OR
*int
in the MyHandler declaration.
in case integer, value :: i or integer, intent(in) :: i
same results
in
On Tuesday, 13 March 2012 at 22:42:38 UTC, Andrej Mitrovic wrote:
I don't think this can work:
alias void function(int) MyHandler;
maybe:
alias extern(C) void function(int) MyHandler;
And there's no need to call it like this: '(*mh)(1)', call it
mh(1).
I know, it's short version.
Anyway,
o
Thanks, but i still get the same.
Guys, thanks for advices.
After all I have proper code.
simple.d
import core.runtime;
import std.stdio;
import std.string;
import std.conv;
version(Windows)
{
import core.sys.windows.windows;
alias GetProcAddress GetProc;
}
else
version(Linux) // not tested
{
import core
Bad English, and I don't have experiense with Wiki.
On Wednesday, 21 March 2012 at 22:21:11 UTC, bearophile wrote:
Michael wrote:
Guys, thanks for advices.
After all I have proper code.
Why don't you write how to do it in the D wiki?
Bye,
bearophile
This behavior of linker caused by a protection suit with sandbox
or similiar technology. Affected systems are win xp, win 7. With
a standard antivirus is all ok.
I have self-made installation of D2 lang (32 bit, dmd2 compiler,
phobos2) that includes dsss, gtk/gtkd, opengl, libxml, iconv,
gtksourceview libs.
Some examples must be manually updated, but compiles properly.
Installation is zip archive with above packages and one *.bat
file that sets an val
On Wednesday, 16 January 2013 at 12:23:51 UTC, Andrey wrote:
class B {
protected int a=123;
}
class A : B {
int f(int b) {
//int a;// <--- I forgot to write this line
...
int CoolThing { in; out; } - auto property without implementation;
int CoolThing { private in; out; } - private setter; public
getter;
int CoolThing
{
in
{
_privateCoolThing = @value * 42;
}
out
{
return 42;
}
}
Explicit calling: void in_CoolThing(int); int out_
On Sunday, 27 January 2013 at 12:07:35 UTC, Jacob Carlborg wrote:
Won't this conflict with contracts, which also uses the "in"
and "out" keywords?
As suggestion:
Property CoolThing looks like code contract for
_privateCoolThing. So it's maybe + or -.
At all, it looks like C# style in D Way.
I think that "property as contract for accessing to variable" is
good point. Maybe we have lack proper terminology, but idea is
good.
Also it is can be pointed as "property itself - is static
contract to accessing variable".
class A{
private int i;
int foo{
out out(result){assert
On Monday, 28 January 2013 at 21:03:04 UTC, Max Samukha wrote:
Let's face it: there are *no* objective criteria for
determining whether a mutator should be a function or property
setter.
Yes, but also it's should be a lightweight action (main idea).
As proposal:
http://forum.dlang.org/post/y
On Tuesday, 29 January 2013 at 19:36:50 UTC, Minas Mina wrote:
My opinion is to allow calling a function without parentheses
only in UFCS (properties must be called without). Is that so
hard to implement?
+1, and workaround:
@property I Do(alias fun, I)(I o)
{
return o is null ? null : (f
As interface api good practice is usage virtual public functions
of classes.
So, (virtual) properties add an additional usefulness.
Static nested struct as property... what is going on...
In this case is better to simply rid-off @property keyword.
"Properties" are better implemented where they created. Maybe
have bugs in design, but I think that property should be a simple
access method/function without struct-and-whatever-
As proposal:
class Example
{
public int IntProperty
{
get; private set;
}
private double _internalMember;
double FloatProperty
{
get out { assert(result > 0); } body { return
_internalMember * 42; }
set in { assert(value != 0); } body { _interna
Just cross posting proposal
http://forum.dlang.org/post/rnwpxkmyihpzqlevh...@forum.dlang.org
Thanks)
On Friday, 8 February 2013 at 23:53:40 UTC, Robert wrote:
Ok. Here finally it is:
http://wiki.dlang.org/DIP26
Best regards,
Robert
Why I should write fun()() when property returns a delegate?
Additional () should not be necessary.
Also combo properties like int get_set_IntValue(int) I thin
Two more things:
Disable a read/write propa like int getSetSomeInteger(int).
int getSomeInteger() and void setSomeIntger(int) only allowed.
And disable default parameter for setter.
It is possible write something like?
auto force = 2.0 * SI.Newton;
auto energy = force * 2.0 * SI.Meter;
In some DSL a struct can be defined as something like:
auto myStruct = new Struct("a:int; b:string; c:boolean");
So this looks like a simple dictionary or AA like Variant[string]
myStruct.
I don't see big difference in use. So D Way approach is Tuple
-simple and good enough.
MS linker by default allocates console window for programm if he
see a main function as entry point and not allocates if he see a
WinMain function as entry point.
So, if I don't want ugly console window for gui app, I can
specify SUBSYTEM:WINDOWS linker flag and change a main to WinMain.
But
Oh, sorry.
Valid linker flag to do this
-L/ENTRY:"_Dmain"
On Sunday, 17 February 2013 at 03:28:29 UTC, js.mdnq wrote:
WPF is pretty nice for .net. Is there any work towards building
a nice gui presentation layer for D, something that has or will
have all those nice modern features we are seeing in stuff like
WPF, QT, etc?
WPF - hardware accelerated
On Sunday, 17 February 2013 at 15:29:56 UTC, Paulo Pinto wrote:
There we go again, XAML is WPF.
xaml can be used with WinForms.
yes, maybe technology the same, but concrete implementations are
different. For example, they all use hardware acceleration.
XAML is a descriptive markup language and has nothing to do
with WinForms.
just google winforms xaml.
And Microsoft is promoting C++/XAML for Windows Store
Applications, you cannot write desktop applications using
WinRT. You're stuck in the desktop world to classic WinAPI/C++
development
On Monday, 18 February 2013 at 15:05:03 UTC, Roy Obena wrote:
The closest thing to WPF that you can use in D is QML/QtD.
So why not support QML/QtD?
Overhead in api bindings.
Wpf and its data banding system are intented for MVVM pattern.
It's have own + and -.
It's more realistic to buil
Although there is a little chance one of the news group folks
has just registered it. :)
We have one more recruit - Foy Savas, rubyist ;)
D definitely have cookies)))
Most allow you to tweak certain aspects, not remove the entire
rendering output and start over. I've never found any OS widget
kit that allows completely and total control of the widget at
the pixel level.
On win mobile if std win forms were not enough, we were able use
win api(good old c and
Wait, wait, so you're saying, this random guy sitting next to
you is, of
all things, coding in D, and you didn't even have a
conversation with
him?!
No time for explain, I will write it in D!!!
Was something changed intentionally or is this a bug?
It was changed intentionally, but only for alias this. That
syntax is allowed still for other aliases.
Bye,
bearophile
I see, thanks. What was the reason for not allowing alias
this = identifier?
Requiring lookahead when parsing.
Al
There is no justification for this.
I guess the main issue is that alias blah this; shouldn't have
made it into the grammar in the first place. But this was
obviously done in order to establish a broken analogy to the
other uses of alias. Either alias this=blah; must be kept or
the alias this
Why I argue that the syntax `alias this = sym;` is wrong?
Because:
1. A normal alias declaration (creating aliased name for
existing symbol)
and alias this feature
(making a *subtyped* struct through implicit access to its
field) are
entirely different and has distinct semantics.
They merely
dmd extern.d
extern.d(22): Error: undefined identifier r, did you mean
template tr(C1, C2, C3
, C4 = immutable(char))(C1[] str, const(C2)[] from, const(C3)[]
to, const(C4)[]
modifiers = null)?
extern.d(22): Error: '__error' must be of integral or string
type, it is a _erro
r_
dmd extern.d
ex
Sorry, this doesn't answer your question but in general, if you
are not going to pass the parameter to another function that
requires a 'string', then it is better to define that function
parameter as 'const char[]':
Tuple!(string[], FnType) parse(const char[] source)
{
// ...
}
That way
Code works good on Win 32, but at start on Win 64 I got:
Exception code: 0xc005
Fault offset: 0x000132c5
void main(string[] args)
{
auto workDir = "build_tmp";
auto currDir = getcwd();
string[] src;
string[] obj;
string cfg = "build.json";
Compiler compiler;
On Friday, 8 March 2013 at 13:25:42 UTC, Michael wrote:
Code works good on Win 32, but at start on Win 64 I got:
Exception code: 0xc005
Fault offset: 0x000132c5
If "auto currDir = getcwd();" commented, error is not appear.
getcwd broken on win 8 x64?
So, there is problem in toUTF8 in std.utf "toUTF8(in wchar[] s)".
string cwd()// copied from phobos
{
writeln("start");
import core.sys.windows.windows;
writeln("buff");
wchar[] ret = new wchar[10240];
writeln("call");
auto n = GetCurrentDirectoryW(to!DWORD(ret.length), re
Dmd 2.062, Win 8 x64
Example from
http://forum.dlang.org/thread/pnuxfheeaqwyfjdqw...@forum.dlang.org
crashes here
dfiles = dirEntries(compiler.srcDestination, "*.d",
SpanMode.depth);
files = dfiles.array;
And "absolutePath" also is broken (as it is use a getcwd as
default param)
As I as
And std.utf is broken on Win 64?
I don't see it crashing over here. What version of dmd are you
using? Do you have some extra long cwd or some non-standard
characters in your path?
Usual path is "D:\Dev\M1xA\D"
OS: Win 8 Pro 64 bit
DMD 2.062
VS 2012 Express for Desktop
Code from Phobos successfully compiles, but crashes on 64
This code works good.
string cwd()
{
import core.sys.windows.windows;
wchar[] ret = new wchar[10240];
auto n = GetCurrentDirectoryW(to!DWORD(ret.length), ret.ptr);
return ret[0 .. n].to!string();
}
Also similar problem/crash occurs in "dirEntries" on 64 bit.
Crash also occurs when
int[] a;
a.length = 10;
So, it's maybe something wrong with ms c runtime of VS 2012.
Just installed Update 2 for VS 2012, not helps.
* It is more natural, what most people would guess on
* It saves another of the 140 characters
* Is much easier to type
I just kill another of 140 chars and add both hashes. More spam -
better marketing.
I believe - we win!
Why Dmd accepts?
class E
{
@property public static pro(Object v)
{
}
}
Dmd 2.062 Win 64
I see.
I agree with Andrej Mitrovic, it's curious feature, but
misleading.
WinMerge on Windows, kdiff on Linux.
On Monday, 7 May 2012 at 02:05:21 UTC, Mehrdad wrote:
Why doesn't this compile?
@property int foo() { return 1; }
@property void foo(int v) { }
void main()
{
foo |= 2;
}
import std.stdio;
int pro = 1;
@property ref auto prop()
{
return pro;
}
@property void prop(int value)
{
I see.
So where to vote for this enhancement?
On Monday, 14 May 2012 at 21:29:52 UTC, Mehrdad wrote:
On Monday, 14 May 2012 at 21:08:15 UTC, Michael wrote:
I see.
So where to vote for this enhancement?
Ugh, wrong link...
should've been:
http://d.puremagic.com/issues/show_bug.cgi?id=8056
Done.
Happy with Mercutial (CLI), Windows family and OpenSUSE ;)
On Tuesday, 22 May 2012 at 10:18:48 UTC, Dejan Lekic wrote:
On Tuesday, 22 May 2012 at 10:03:36 UTC, Roman D. Boiko wrote:
http://d-coding.com/2012/05/22/is-the-d-community-lacking-development-tools.html
My opinion - no.
Sure, all of them can be better, provide more fancy features,
etc...
+
In WinAPI we have: LoadLibraryA/W, but not GetProcAddressA/W
because PE COFF limitations exists.
Walter Bright
The user can decide what to use or not use from it.
+1. For me LoadLibraryA works well.
256 max path
It's FS limitation.
approximately 32,000 characters...
I know it ;) But it's platform specific kung-fu.
I knew it till an .net era. Main line is even Windows may handle
it in a wrong way.
WinAPi - interface "as is". So let user decides to use or not.
;
}
}
The problem with the template is I cannot pass any argument into
"F". How should I fix this problem?
Also, I am not entirely sure why I need to write "alias F"
instead of just "F", any explanation would be appreciated.
Thank you guys,
Michael
Thank you all of you for your help!
Michael
On Sunday, 24 June 2012 at 06:49:38 UTC, Philippe Sigaud wrote:
The closest I came to the correct template is
template(alias F) timer {
auto timer {
auto start = Clock.currStdTime();
F();
return Clock.currStdTime() - time;
}
}
The
On Thursday, 28 June 2012 at 00:33:28 UTC, Knud Soerensen wrote:
Hi.
I looking into making a website for the cloud
and I was wondering if anyone have tried D in connection with
amazon EC2, Google app engine or similar cloud service ?
You can take a look on Azure VM (linux or windows).
I am a
Any news?
On Saturday, 4 August 2012 at 20:53:53 UTC, Adam D. Ruppe wrote:
On Saturday, 4 August 2012 at 19:08:58 UTC, Jacob Carlborg
wrote:
foo += 10;
Is rewritten as:
auto __tmp = foo;
foo = __tmp + 10;
I did this and now I think this thing is almost done
===
int a;
@property int funcprop() {
Hi,
I have C++ code:
-
#define dllExport __declspec(dllexport)
namespace fltk = fltk3;
class dllExport FltkWindow : public fltk::Window
{
public:
FltkWindow(int w, int h, const char* title =
nullptr):fltk::Window(w, h, title) { }
};
dllExport FltkWindow* get_Win(int w, int
I'm probably trying to complicate things too much while not really
understanding what I'm doing... I want to be able to call D code from R. (R is
a language for doing statistics)
When I try to load the code, I get an error:
dlopen( PATH/test.so, 6): Symbol not found: __minfo_beg
what I did is the
== Quote from Jacob Carlborg (d...@me.com)'s article
> First, have you built Tango as a dynamic library, using "bob" with the
> "-d" flag? Oh I see now that you use an older version of Tango. Download
> the latest version from trunk and use "bob" with the "-d" flag to build
> Tango as a dynamic lib
Full support of Unicode in upcoming release at end of August.
OS X in progress, help needed.
Development and bugs fixing are very active, mailing lists
available via sf.net.
But where's the bug tracker?
Cite:
The official support mechanism is by e-mail, using
i...@tecgraf.puc-rio.br
Additional info on official site ;)
By the way there is no problem in communication with Tecgraf IUP
team.
[1] :
http://forum.dlang.org/thread/pvplfosyrrgigtusp...@forum.dlang.org#post-afokkalgzxrsbnvpqgou:40forum.dlang.org
[2] : https://bitbucket.org/alphaglosined/libglosined (see the
iup directory)
It's looks as low-level-one-to-one D binding to C.
Now I trying to build a somewhat from examples
On Thursday, 22 August 2013 at 21:11:32 UTC, Andrej Mitrovic
wrote:
On 8/22/13, Michael wrote:
Cite:
The official support mechanism is by e-mail, using
i...@tecgraf.puc-rio.br
Well that's discouraging..
For me it's no problem)
For additional comments it's better to contact
On Thursday, 22 August 2013 at 21:44:57 UTC, Andrej Mitrovic
wrote:
On 8/22/13, Michael wrote:
For me it's no problem)
How are other people supposed to track bugs? Anytime someone
runs into
a bug that other people have already run into, the user has to
waste
time writing emails whe
On Tuesday, 3 September 2013 at 13:13:11 UTC, Elvis wrote:
http://adambard.com/blog/top-github-languages-for-2013-so-far/
GitHub is GitHub only ;)
SourceForge Index: 21, TIOBE Index: 22.
Over last year the D has a positive trend on TIOBE. Waiting for
September's update.
/* The language for
On Wednesday, 4 September 2013 at 05:02:06 UTC, Peter Alexander
wrote:
On Tuesday, 3 September 2013 at 17:09:04 UTC, Michael wrote:
Main line is positive trend over all year ;)
On Sunday, 8 September 2013 at 09:15:52 UTC, Namespace wrote:
I'm against it. More important than such a gimmick are the many
open bugs, auto ref, AA, scope, etc. And don't forget the
implementation of the virtual keyword.
+1
On Friday, 13 September 2013 at 19:48:18 UTC, Namespace wrote:
Just out of interest.
I use Sublime 2, Notepad++ and as IDE currently Mono-D. But I
will try this evening VisualD.
Sublime Text 3 or TextAdept, 4 whitespaces as tab)))
Well D is now position 39 (September 2013)!
Challenge accepted)))
KDE, Gnome, Unity, Xfce wtf?
Win 8.1 rocks)
On Sunday, 15 September 2013 at 18:24:11 UTC, Dicebot wrote:
On Sunday, 15 September 2013 at 18:21:35 UTC, Michael wrote:
KDE, Gnome, Unity, Xfce wtf?
Win 8.1 rocks)
I was astonished when had a look at Win 8 preview and have
noticed basically Shell / Unity overview as a start screen
Besides, we aren't on 300 baud serial lines!
As backup line I have 56k dial-up modem ;)
We still trolling each other about IDE ?) Or Win 8.1 UI is the
best UI?
1 - 100 of 355 matches
Mail list logo