On Saturday, 8 May 2021 at 20:50:10 UTC, Vinod K Chandran wrote:
Hi all,
I am planning some win32 hobby projects. Now I have this
function to tackle the LPCWSTR data type in win32.
```d
private import std.utf;
auto toWString(S)(S s) { return toUTFz!(const(wchar)*)(s); }
```
Is there any better
I want to be able to dynamically remove some routes in my Vibe.d
application.
URLRouter accounts for newly added routes, but I can't find a way
to clear routes unless I create the new URLRouter object, in
which case I also need to re-create HTTP listener.
Also, is it safe to replace already
On Thursday, 17 December 2020 at 19:45:38 UTC, Dave P. wrote:
In C, you can use a macro to get the source text of an
expression as a string. For example
#include
#define PRINT_INT(x) printf(#x " = %d\n", x)
int main(){
// prints "3 = 3"
PRINT_INT(3);
int x = 4;
// prints "x =
On Sunday, 15 November 2020 at 00:05:08 UTC, Marcone wrote:
Socket s = new Socket(AddressFamily.INET, SocketType.STREAM);
s.connect(new InternetAddress("domain.com", 80));
I want that program raise an error if reach for example 30
seconds of timeout.
Perhaps using Socket.select and
On Monday, 12 October 2020 at 16:44:52 UTC, Ali Çehreli wrote:
It's amazing how things come together before each conference.
Flag appears among my slides for an upcoming conference as
well! :)
But I don't think there is any solution to your problem.
On 10/12/20 3:24 AM, FreeSlave wrote:
>
On Monday, 12 October 2020 at 11:34:25 UTC, Vladimir Panteleev
wrote:
On Monday, 12 October 2020 at 10:24:44 UTC, FreeSlave wrote:
Can this issue overcome somehow?
Why not add a deprecated overload for your function which takes
the old Flag value?
I thought about overloading too.
Let's say I use Flag type named 'myflagname' in API like this:
import std.typecons;
void func(Flag!"myflagname" flag)
{
//...
}
void main()
{
func(Yes.myflagname);
}
Later I realize that 'myflagname' is a bad name and I want to
change it to something else. But if I do so, I break the
Druntime has a limited set of declarations, lacking some COM
interfaces, e.g. IShellItem and IFileOperation (the latter is
understandable though as it was introduced in Vista, and I guess
druntime declarartions are limited to symbols from XP), and some
others are declared wrongly (e.g.
On Thursday, 10 September 2020 at 15:20:54 UTC, John Chapman
wrote:
On Thursday, 10 September 2020 at 13:30:15 UTC, FreeSlave wrote:
Thanks. I tried this, but VarDateFromStr does not succeed for
me.
It turns out the shell embeds some control characters in the
string, specifically 8206 and
On Thursday, 10 September 2020 at 06:43:35 UTC, John Chapman
wrote:
On Wednesday, 9 September 2020 at 22:44:50 UTC, FreeSlave wrote:
Btw do you know how to parse a date returned by GetDetailsOf?
Couldn't find any examples in C++. I actually can see digits
representing date and time as a part
On Wednesday, 9 September 2020 at 07:18:04 UTC, John Chapman
wrote:
On Tuesday, 8 September 2020 at 22:24:22 UTC, FreeSlave wrote:
However if I change the type of recycleBin variable to
IShellFolder (not IShellFolder2), the crash does not happen.
Does IShellFolder2 require some special
Consider the following code:
import core.sys.windows.windows;
import core.sys.windows.shlobj;
import core.sys.windows.wtypes;
import std.exception;
pragma(lib, "Ole32");
void main()
{
OleInitialize(null);
scope(exit) OleUninitialize();
IShellFolder desktop;
LPITEMIDLIST
On Tuesday, 25 August 2020 at 18:42:53 UTC, codic wrote:
I'd like to be able to change the callback of a vibe.d Timer
(eg created with
http://vibe-core.dpldocs.info/v1.9.3/vibe.core.core.createTimer.html) after creation, something like:
auto timer = createTimer();
timer.rearm(duration,
On Tuesday, 25 August 2020 at 03:41:06 UTC, Jon Degenhardt wrote:
What's the best way to get the element type of an array at
compile time?
Something like std.range.ElementType except that works on any
array type. There is std.traits.ForeachType, but it wasn't
clear if that was the right
On Saturday, 25 July 2020 at 14:19:15 UTC, Steven Schveighoffer
wrote:
The only way to do this without code duplication (but with
generated code duplication) is to template the byAction
function on the type of `this`:
auto byAction(this This)() { /* same implementation */ }
Note that this
On Saturday, 25 July 2020 at 18:06:51 UTC, powerboat9 wrote:
Does dlang have an analog to Result or Option types from rust?
Standard library has std.typecons.Nullable
https://dlang.org/phobos/std_typecons.html#Nullable
Note that objects are nullable by themselves as classes are
reference
I want to be able to return a range of const objects from the
const object and a range mutable objects from the mutable object.
inout comes to mind, but not applicable in this case, because
inout must be applied to the return type as whole, which does not
make much sense for the range.
On Monday, 20 July 2020 at 20:55:52 UTC, Steven Schveighoffer
wrote:
I don't want any user interaction. Occasionally, I get a
repository that no longer exists (404). Then git comes up and
asks for a username/password. I want it to just fail.
Apparently git has no option to be
Consider the following code. It counts the number of
subdirectories in directories provided via commandline args.
import std.stdio;
import std.algorithm;
import std.file;
import std.range;
import std.exception;
@trusted bool isDirNothrow(string dir) nothrow
{
bool ok;
On Friday, 15 March 2019 at 21:48:50 UTC, DFTW wrote:
What am I missing here?
Maybe the terminal and your utility you run wkhtmltopdf from have
different environment?
On Friday, 7 September 2018 at 16:44:09 UTC, Russel Winder wrote:
I guess this might work on Windows, but I am on Linux and OSX,
so I'll have to try another route.
On Posix systems you may try using SIGCHLD handler. Google for
exact examples.
On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote:
From what I can see, processes created with std.process:
spawnProcess are not terminated when the creating process
terminates, i.e. it seems Config.detached is the default for
these process.
No, detached is not default. By
On Thursday, 21 June 2018 at 18:46:05 UTC, Dr.No wrote:
How can I do that with D?
In C# you can do that:
var filename = @"C:\path\to\my\file.txt";
var file = new Uri(filename).AbsoluteUri;
// file is "file:///C:/path/to/my/file.txt"
How can I do that in D?
import std.stdio;
import
On Friday, 27 April 2018 at 12:37:04 UTC, Basile B. wrote:
On Thursday, 26 April 2018 at 18:16:01 UTC, FreeSlave wrote:
Most dub packages are libraries and should provide runnable
examples.
What's the current idiomatic way to add examples?
IMO the most simple way (and the best too) is to put
Most dub packages are libraries and should provide runnable
examples.
What's the current idiomatic way to add examples? I used
sub-packages with dependency on the library and "*" as version
and running them as dub run :examplename
Now I've noticed vibed uses a different scheme - examples are
On Wednesday, 14 February 2018 at 15:24:42 UTC, Vino wrote:
On Wednesday, 14 February 2018 at 12:29:13 UTC, rikki
cattermole wrote:
[...]
Hi Rikki,
Wouldn't this be easy to use with std.process: execute
package and calling wmic.exe, the only problem is i am not sure
hot to get the out
On Friday, 8 December 2017 at 19:13:20 UTC, vino wrote:
Hi,
The code is same just copy pasted the code form Windows 7 into
Windows 2003 and executed, in Windows 7 the log file is of size
0 where as in windows 2003 the log file is of size 2 byte where
the log file in both the server is
On Friday, 8 December 2017 at 09:40:18 UTC, Vino wrote:
Hi All,
Request your help on how to check whether a given file is
empty, I tried the getSize from std.file but no luck as in
windows 7 is the file is empty the size of the file is 0 bytes
but in Windows 2003 if the file is empty the
On Friday, 20 October 2017 at 10:47:57 UTC, Andrew Edwards wrote:
Given a documented source file (eg. process.d), I can generate
the DDOC version of the documentation with the -D switch of DMD
as such:
$ dmd -Dfprocess.html process.d
What do I modify on that line to get the DDOX version
On Friday, 25 August 2017 at 19:55:09 UTC, timvol wrote:
Hi guys,
I want execute a process. I know, I can execute a process using
"spawnProcess" or "executeShell". But I want exit the parent.
My code for testing purposes is the following:
int main(string[] asArgs_p)
{
if (
On Friday, 25 August 2017 at 19:55:09 UTC, timvol wrote:
Hi guys,
I want execute a process. I know, I can execute a process using
"spawnProcess" or "executeShell". But I want exit the parent.
My code for testing purposes is the following:
int main(string[] asArgs_p)
{
if (
On Tuesday, 16 May 2017 at 08:32:56 UTC, Nordlöw wrote:
What's the status of atomicity of file-copying and -moving
(renaming) using std.file on different platforms?
Not sure about renaming but copying is not atomic on Posix
because it does not handle interruption by signal. I opened issue
On Tuesday, 25 April 2017 at 07:05:51 UTC, Suliman wrote:
Just interesting. Is there any rational reasons for this
decision?
There's no File in std.file. It's located in std.stdio.
std.stdio and std.file are different modules. The first one has
safe wrappers around stdio.h from C library, the
On Tuesday, 18 April 2017 at 17:58:32 UTC, WhatMeWorry wrote:
On Tuesday, 18 April 2017 at 15:15:47 UTC, Stanislav Blinov
wrote:
On Tuesday, 18 April 2017 at 15:07:27 UTC, WhatMeWorry wrote:
When I try to upload these files to my new repo, GitHub
(rightfully so) complains that
I have too many
On Sunday, 2 April 2017 at 16:03:51 UTC, FreeSlave wrote:
On Sunday, 2 April 2017 at 16:02:06 UTC, FreeSlave wrote:
On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote:
[...]
Now I see. 'Using C++ Classes From D' crashes for me too. It
also returns the wrong value from 'field' method.
On Sunday, 2 April 2017 at 16:02:06 UTC, FreeSlave wrote:
On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote:
On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote:
This page has many examples. Which exactly do you try to run
and how do you build it? Which compilers, OS?
My bad.
On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote:
On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote:
This page has many examples. Which exactly do you try to run
and how do you build it? Which compilers, OS?
My bad. I've tested example under caption Using C++ Classes
From D. I
On Saturday, 1 April 2017 at 07:37:25 UTC, ANtlord wrote:
Hello!
Can somebody give a relevant example shows how to use C++
classes in D? I've used the exmaple from
https://dlang.org/spec/cpp_interface.html but I get a
segmentation fault as result of D application. My application
shows
On Tuesday, 4 October 2016 at 17:02:34 UTC, Adam D. Ruppe wrote:
On Tuesday, 4 October 2016 at 16:55:22 UTC, Andre Pany wrote:
Spawn process is working fine on linux, only on windows it
doesn't work.
I will create a bug report.
This isn't really a bug if it is a cmd file like the other
On Tuesday, 4 October 2016 at 12:58:19 UTC, Andre Pany wrote:
Hi,
I need to call a Node application. node and npm are in windows
path variable.
I have following folder structure:
./app.d
./js/helloworld.js
./js/package.json
[...]
npm is .cmd file on Windows. Maybe this is issue. Looks like
On Thursday, 30 June 2016 at 21:56:57 UTC, Special opOps wrote:
How can I get the program stats at run time such as minimum and
maximum amount of memory and cpu used, cpu architecture, os,
etc?
OS is compile-time constant.
http://dlang.org/phobos/std_system.html#.os
Or do you look for
On Tuesday, 7 June 2016 at 15:33:57 UTC, chmike wrote:
Hello
I'm writing some code that I want to be portable across Posix
and Windows.
What is the recommended code convention for such type of code ?
80% of the class implementation is the same for both OS.
Should I write the following and
On Tuesday, 24 May 2016 at 20:03:14 UTC, pineapple wrote:
I would've expected this to work, but instead I get a compile
error. Is my syntax wrong? Is this just not a case that map can
handle, and I should be doing something else?
import std.algorithm : map;
import std.conv : to;
I have two files. The one has Objective-C functions and
interfaces declarations written in D. Another file is main app
and it imports the first and uses its functions.
Imported file: http://codepad.org/jqdBb6sh
Main file: http://codepad.org/0gKBqKxi
When I compile them in one command it run
On Friday, 22 April 2016 at 11:07:47 UTC, Jeff Thompson wrote:
On Friday, 22 April 2016 at 09:40:14 UTC, FreeSlave wrote:
On Friday, 22 April 2016 at 09:25:32 UTC, Jeff Thompson wrote:
Hello. The following code compiles OK where func creates a
mutable array and main assigns it to an immutable
On Friday, 22 April 2016 at 09:25:32 UTC, Jeff Thompson wrote:
Hello. The following code compiles OK where func creates a
mutable array and main assigns it to an immutable variable:
[...]
Probably this is what you look for
http://dlang.org/phobos/std_exception.html#.assumeUnique
std.windows.syserror and others have documentation comments, but
they are not listed in online documentation on dlang.org. Is it
ok to use functions and classes from this modules in D
applications?
On Thursday, 28 January 2016 at 04:26:26 UTC, Taylor Hillegeist
wrote:
Just curious... I had a thought that perhaps since Objective C
was a replacement for Pascal on the mac. that they might have
the same interface. but I'm not savvy enough with fpc to figure
out how to try it.
Not directly.
On Thursday, 21 January 2016 at 13:26:15 UTC, W.J. wrote:
On Wednesday, 20 January 2016 at 16:01:11 UTC, Dibyendu
Majumdar wrote:
Hi,
I am trying to understand the options for distributing a D app
to users. My assumption is that only the shared libraries and
binaries need to be distributed,
Here's code:
private {
import std.algorithm;
import std.range;
import std.typecons;
alias Tuple!(int, string) Data;
}
private bool myCmp(Data a, Data b) {
return a[0] < b[0];
}
auto bar() {
return [Data(1, "one"), Data(2, "two")].assumeSorted!myCmp;
}
void main()
{
On Tuesday, 8 September 2015 at 04:04:16 UTC, Sebastiaan Koppe
wrote:
Fixed it by changing into:
```
import std.conv : text;
string json =
File("../languages.json","r").byLineCopy().joiner.text;
auto ls = json.parseJSON();
```
Why would you read file by line and then merge
Let's say I have two dub packages: A and B.
A is a library. B is library or application (does not matter) and
depends on A.
A has several configurations in dub.json.
How to build the B package that way it will use non-default
configuration of A?
On Sunday, 6 September 2015 at 23:05:29 UTC, Jonathan M Davis
wrote:
http://dlang.org/phobos/std_file.html#.getAttributes will get
you all of the file attributes for a file, though you'll have
to look at the Windows and POSIX documentation to know how to
interpret that.
- Jonathan M Davis
On Wednesday, 2 September 2015 at 05:00:42 UTC, drug wrote:
02.09.2015 00:08, Jonathan M Davis via Digitalmars-d-learn
пишет:
On Tuesday, September 01, 2015 20:05:18 drug via
Digitalmars-d-learn wrote:
My case is I don't know what type user will be using, because
I write a
library. What's the
On Wednesday, 26 August 2015 at 08:30:04 UTC, Yazan D wrote:
On Wed, 26 Aug 2015 08:27:05 +, FreeSlave wrote:
Are there ways to fix this? Should I consider writing my own
range type probably?
Check
http://dlang.org/phobos/std_algorithm_iteration.html#.cache
I tried it. It can help
Example:
import std.stdio;
import std.algorithm;
import std.path;
import std.file;
import std.exception;
import std.getopt;
import std.array;
import std.range;
auto algo(string fileName, string[] dirs, string[] extensions)
{
return dirs.filter!(delegate(dir) {
bool ok;
On Monday, 17 August 2015 at 15:05:56 UTC, Andre Polykanine wrote:
Hi everyone,
I'm new to D (I'm learning it by reading the great online book
by Ali
Çehreli - thank you very much for it, sir!), and, more
than that,
programming is my hobby, so please bear with me if I'm asking
stupid
On Sunday, 16 August 2015 at 12:30:54 UTC, cym13 wrote:
On Sunday, 16 August 2015 at 11:53:42 UTC, FreeSlave wrote:
[...]
Ok, so as my lambda proposition obviously doesn't work, here is
one way that does using a templated function. There may be a
way to make it shorter, I don't know.
Let's say I want to map some range using some context.
The obvious way is to do:
uint[3] arr = [1,2,3];
uint context = 2;
auto r = arr[].map!(delegate(value) { return value * context; });
The problem is that this allocates delegate, so it can't be used
in @nogc code.
What I want to do might
On Sunday, 16 August 2015 at 16:23:05 UTC, FreeSlave wrote:
On Sunday, 16 August 2015 at 15:29:10 UTC, Ali Çehreli wrote:
On 08/16/2015 04:53 AM, FreeSlave wrote:
The problem is that this allocates delegate, so it can't be
used in
@nogc code.
Would constructing the delegate by setting its
On Sunday, 16 August 2015 at 15:29:10 UTC, Ali Çehreli wrote:
On 08/16/2015 04:53 AM, FreeSlave wrote:
The problem is that this allocates delegate, so it can't be
used in
@nogc code.
Would constructing the delegate by setting its .funcptr and
.ptr properties work in this case? You can have
On Thursday, 16 July 2015 at 21:12:05 UTC, anonymous wrote:
I have the following code, working under Win and Linux:
---
import std.process: environment;
immutable string p;
static this() {
version(Win32) p = environment.get(APPDATA);
version(linux) p = /home/ ~ environment.get(USER);
On Friday, 17 July 2015 at 07:33:43 UTC, Anonymous wrote:
On Friday, 17 July 2015 at 07:14:24 UTC, FreeSlave wrote:
On Thursday, 16 July 2015 at 21:12:05 UTC, anonymous wrote:
I have the following code, working under Win and Linux:
---
import std.process: environment;
immutable string p;
On Thursday, 2 July 2015 at 12:47:52 UTC, Nicholas Wilson wrote:
On Thursday, 2 July 2015 at 12:19:06 UTC, Steven Schveighoffer
wrote:
On 7/2/15 8:10 AM, Nicholas Wilson wrote:
[...]
Try dmd -v, it will tell you the link line. Then you can try
it yourself to see how to get it to work. I
On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote:
Hi,
I encountered the following error:
Error: function files.SHGetFolderPath (void* hwndOwner, int
nFolder, void* hToken, uint dwFlags, char* pszPath) is not
callable using argument types (typeof(null), int, typeof(null),
int,
On Tuesday, 16 June 2015 at 13:31:47 UTC, FreeSlave wrote:
Also you may want to take a look at my library [1] where I use
SHGetSpecialFolderPath (I know, it's deprecated, but it still
works, so why not. I don't really need to bother with access
tokens here).
Note that I load shell32
On Friday, 22 May 2015 at 12:12:46 UTC, tcak wrote:
I know there is mutable variables, but what is a mutable method?
Error message says mutable method
project.mariadb.connector.ver2p1.resultset.ResultSetColumn.info
is not callable using a const object.
The method that can change the state
On Thursday, 16 April 2015 at 08:51:15 UTC, TheGag96 wrote:
Hi, I've got this project that requires me to link into a C++
backend. It works just fine when using GDC:
gdc *.d [client libraries]
However, this command using DMD does not work:
dmd -L-lstdc++ *.d [client libraries]
I still get
On Sunday, 12 April 2015 at 04:39:06 UTC, Philip Stuckey wrote:
why not:
import std.stdio;
stdout = File(args[4], w+);
stderr = File(args[4], w+);
It just replaces the object, not redirects output. E.g. if you
use printf somewhere it will use stdout, not file.
I think I found solution using opBinaryRight
import std.range;
struct S
{
int i;
string s;
int opCmp(int i) {
return this.i - i;
}
int opCmp(ref const S s) {
return this.i - s.i;
}
int opBinaryRight(string op)(int i) if (op == ) {
return i
I have array of structs sorted by specific field. How can I
perform binary search using this field as a key?
Currently I ended up with this, but it gives error:
struct S
{
int i;
string s;
}
import std.range;
void main(string [] args)
{
S[] structs = [{1,hello}, {2,world}, {3,
On Sunday, 5 April 2015 at 23:15:04 UTC, w0rp wrote:
On Sunday, 5 April 2015 at 23:06:27 UTC, FreeSlave wrote:
I have array of structs sorted by specific field. How can I
perform binary search using this field as a key?
Currently I ended up with this, but it gives error:
struct S
{
int i;
On Monday, 1 September 2014 at 13:31:32 UTC, Matt wrote:
If I were to use Runtime.loadLibrary(), it claims to merge any
D GC in the shared lib with the current process' GC.
Do I need to version away symbol loading code for each platform?
Or is there already code in Phobos that allows us to do
On Sunday, 24 August 2014 at 11:56:44 UTC, nikki wrote:
I come from languages that don't offer structs, I have this
json load function that has to keep some data and intuitively
I've written a struct, I've read about the differences, heap vs
stack, value vs reference, but know I think i am
On Monday, 18 August 2014 at 10:07:30 UTC, Remi Thebault wrote:
Hi
Starting to use GtkD TreeModel, I write an instance of an
abstract class to TreeIter.userData.
When reading back the void pointer and casting to my abstract
class leads to crash when instance is used (Task is the
abstract
On Friday, 15 August 2014 at 03:10:43 UTC, Etienne Cimon wrote:
I'm looking into making a binding for the C++ API called Botan,
and the constructors in it take a std::function. I'm wondering
if there's a D equivalent for this binding to work out, or if I
have to make a C++ wrapper as well?
On Wednesday, 30 July 2014 at 20:51:25 UTC, Daniel Kozak via
Digitalmars-d-learn wrote:
V Wed, 30 Jul 2014 14:33:51 +
seany via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
napsáno:
In Ali's excllent book, somehow one thing has escaped my
attention, and that it the mentioning of
On Thursday, 31 July 2014 at 11:34:38 UTC, Kozzi11 wrote:
Is possible to somehow split class declaration and definition.
I mean something like this:
class C
{
void hello(); // just prototype
}
class C
{
void hello()
{
//actual code
}
}
or something like this
void
On Thursday, 31 July 2014 at 12:05:53 UTC, francesco cattoglio
wrote:
Really simple question:
how do I get the compiler-generated hash function for a given
type?
For example:
Struct S
{
int i;
}
can be used in an associative array. That means the compiler
generates a toHash function. Is
On Wednesday, 23 July 2014 at 15:35:59 UTC, Chris wrote:
The C++ code does this:
size_t fwrite ( const void * ptr, size_t size, size_t count,
FILE * stream );
// stream is stdout
and text appears in the console (a string).
I don't how to grab the text that is written to console. I
might
On Tuesday, 22 July 2014 at 07:58:50 UTC, Puming wrote:
Is there a fork()/wait() API similar to std.concurrency spawn()?
The best thing I've got so far is module
core.sys.posix.unistd.fork(), but it seems to only work in
posix. Is there a unified API for process level concurrency?
ideally
Note that BOMs are optional and may be not presented in Unicode
file. Also presence of leading bytes which look BOM does not
necessarily mean that file is encoded in some kind of Unicode.
On Tuesday, 22 July 2014 at 14:26:05 UTC, Puming wrote:
I've only found spawnProcess/spawnShell and the like, which
executes a new command, but not a function pointer, like fork()
and std.concurrency.spawn does.
What is the function that does what I describe?
On Tuesday, 22 July 2014 at
Derelict contains bindings to other libraries, not these
libraries themselves. dub downloads only these bindings, not
original libraries (since they are written in C, not D, and not
included in dub repositories). You should manually get necessary
libraries and put them in folder where .exe
On Thursday, 26 June 2014 at 09:05:23 UTC, pgtkda wrote:
How can i close my application by code?
Do you mean exit status? Just call exit function from C library.
import std.c.stdlib;
void main()
{
exit(0);
}
On Thursday, 26 June 2014 at 11:07:37 UTC, Rene Zwanenburg wrote:
On Thursday, 26 June 2014 at 10:40:00 UTC, John Colvin wrote:
On Thursday, 26 June 2014 at 09:58:50 UTC, FreeSlave wrote:
On Thursday, 26 June 2014 at 09:05:23 UTC, pgtkda wrote:
How can i close my application by code?
Do you
On Monday, 23 June 2014 at 01:16:49 UTC, Evan Davis wrote:
As the subject says, I would like to pass around an array of
functions. The trick is, that the functions have different type
signatures. Is there a way to put the two functions
int foo(int a, int b);
bool bar(bool a, bool b);
into
Dub has option called --annotate. It's described like this:
Do not perform any action, just print what would be done
I supposed it's something similar to -n option of Jam build
system (I really like this feature). But dub's annotate prints
nothing. So what is that? I have DUB version 0.9.21
I don't think you always need documentation for all exception
classes, since the most of them have the same interface. Usually
it's worth to describe where is some exception able to be thrown
from, not exception itself. And it's covered by function
documentation, not by documentation of
On Saturday, 14 June 2014 at 11:59:53 UTC, Paul wrote:
One stupid question: in Python subclassing of Exception looks
like:
class MyError(Exception): pass
but in D, if I'm right, we should write more code:
class MyError : Exception {
this(string msg) { super(msg); }
}
(without
It seems like you're trying to compile 64-bit code when you are
on 32-bit system and you have 32-bit libphobos.
I conclude that because I have similar errors when trying to
build 64-bit library on 32-bit system.
/usr/bin/ld:
/usr/lib/x86_64-linux-gnu/libphobos2.a(format_712_5b3.o):
relocation R_X86_64_32 against `.rodata' can not be used when
making a shared object; recompile with -fPIC
dmd has -shared option. Try it instead of -L-shared.
On Friday, 6 June 2014 at 16:33:27 UTC, Adam D. Ruppe wrote:
When you compile the final program, the library .d file needs
to be available too, either in the folder based on its name or
passed straight to dmd explicitly.
Despite the presence of the .lib file, the .d file is still
needed so
On Sunday, 11 May 2014 at 07:31:10 UTC, FreeSlave wrote:
On Friday, 9 May 2014 at 21:42:14 UTC, Vlad Levenfeld wrote:
Is this still the case if the method is const or pure?
Const methods still require synchronization, because other
threads may change some data, needed by const method while
On Friday, 9 May 2014 at 21:42:14 UTC, Vlad Levenfeld wrote:
Is this still the case if the method is const or pure?
Const methods still require synchronization, because other
threads may change some data, needed by const method while method
is executed, and then you may get wrong results.
On Sunday, 11 May 2014 at 05:34:38 UTC, Moses wrote:
On Sunday, 11 May 2014 at 04:33:24 UTC, Ali Çehreli wrote:
On 05/10/2014 07:12 PM, Moses wrote:
After using the 1-click Ubuntu installer, I'm having trouble
figuring
out how to import standard library functions for Phobos. I
get the
On Saturday, 10 May 2014 at 20:24:50 UTC, MarisaLovesUsAll wrote:
Hi!
I sometimes got a useless messages in stdout from SDL_Image
library, and I want to temporary silence it. How do I do?
You can temporary redirect output to file. Example (on C):
#include stdio.h
#include unistd.h
#include
On Sunday, 11 May 2014 at 07:43:07 UTC, Kagamin wrote:
Known bug https://issues.dlang.org/show_bug.cgi?id=2742
It's not bug. Write-functions are designed to output text to
stdout, and it's issue of programmer to make sure that expected
acceptor can interpret them properly. Note that stdout
What are compiler and platform do you use? Probably you are
trying to link with 64-bit library while being on 32-bit OS (or
vice versa)
It works fine on my 32-bit Debian with ldc2 and dmd.
1 - 100 of 101 matches
Mail list logo