Well, for anyone who is tangling with similar mysteries, I
finally got something to work the way I wanted it to. Thank you
for the help, Adam and kinke!
The first "x" argument was stored in R8. The second "y" argument
was stored in RDX. The invisible return value pointer was stored
in RCX.
Ah, I've got something working!
It's not exactly what I wanted, but it's good enough for now.
Instead of using an invisible output pointer, the output pointer
is passed in explicitly.
struct Result {
ulong low;
ulong high;
}
void retTest(Result* result) {
v
On Thursday, 15 November 2018 at 21:48:46 UTC, kinke wrote:
The MS docs are complete IIRC. The pointer to the pre-allocated
result of your 16-bytes struct is passed in RCX.
If unsure, just reverse-engineer what you need: type it down in
normal D and analyze the generated assembly. You can even d
On Thursday, 15 November 2018 at 21:12:39 UTC, Adam D. Ruppe
wrote:
On Thursday, 15 November 2018 at 21:07:51 UTC, pineapple wrote:
Is there a way to access this pointer?
It is passed as.. I think the final argument to the function.
(unless it is the first, do a quick test to find out).
Als
On Thursday, 15 November 2018 at 21:00:10 UTC, Adam D. Ruppe
wrote:
It would be part of the abi:
https://dlang.org/spec/abi.html#function_calling_conventions
though it references C so you might need to look that up too.
That's helpful, thank you!
For other sized structs and static arrays, the
I've managed to get a few functions working before mostly by
copying whatever Phobos was doing for a similar purpose, but now
that I'm trying to do something different I am really hitting a
wall.
My issue is that I can't figure out how to access a function's
arguments from within inline asm o
Speaking of which, is there any AppVeyor config or script laying
around somewhere for how to install 64-bit DMD? Since I would
ideally like to automate testing with both 32-bit and 64-bit DMD
I do mach.d - https://github.com/pineapplemachine/mach.d
I've been setting up CI tests and OSX and Linux tests are good to
go thanks to Travis. I'm having a little more difficulty with
testing on Windows via AppVeyor, since DMD is too memory-hungry
to `dub test` without a fatal error when DMD
When I run code on OSX and it produces a stack trace, the output
uses mangled symbols and is missing line numbers, like so - how
can I change these stack traces to be more readable?
0 objectpool 0x000104e9a3bc
_D4core7runtime18runModuleUnitTestsUZ19unittestSegvHa
On Saturday, 22 July 2017 at 20:55:06 UTC, kerdemdemir wrote:
And what if I want to go diagonal like 1,5,9 or 3,5,7 in the
example above. Is there a good solution in std without using
for loops?
I suggest using an actual matrix type for tasks like this. I
don't know about diagonal slicing, bu
It is worth noting too that mach's map function will not behave
this way; UTF encoding and decoding is instructed explicitly and
is not done implicitly like in phobos.
https://github.com/pineapplemachine/mach.d
import mach.range : map, asarray;
import mach.text.ascii : toupper;
vo
On Friday, 12 May 2017 at 21:23:23 UTC, Steven Schveighoffer
wrote:
Note, you can achieve what you want with version(unittest):
Please prefer `private version(unittest){...}` if the module
might be imported by someone else's code, as to not pollute it
with unneeded symbols
On Friday, 3 March 2017 at 18:09:02 UTC, Jonathan M. Wilbur wrote:
I have tried to come up with a good way to get the mantissa,
exponent, and base from a real number, and I just can't come up
with a good cross-platform way of doing it. I know about
std.math.frexp(), but that function only gives
One reason for zero-based indexes that isn't "it's what we're all
used to" is that if you used one-based indexes, you would be able
to represent one fewer index than zero-based, since one of the
representable values - zero - could no longer be used to
represent any index.
Also, it's what we'r
On Monday, 30 January 2017 at 11:03:52 UTC, Profile Anaysis wrote:
I need to yield from a complex recursive function too allow
visualizing what it is doing.
e.g., if it is a tree searching algorithm, I'd like to yield
for each node so that the current state can be shown visually.
I realize t
On Tuesday, 24 January 2017 at 20:15:38 UTC, Dlearner wrote:
Hey all!
I'm learning programming through D and having a really good
time (much better than with C++ or Python). I'm aiming to make
little games with it as a hobby so I've learned some OpenGL
stuff.
But, I feel like I'm learning mo
On Monday, 23 January 2017 at 15:15:35 UTC, aberba wrote:
I'm creating a function to authenticate user login. I want to
determine login failure (Boolean) and error message (will be
sent to frontend) but D does have multiple return type (IMO
could use struct but will make code dirty with too muc
On Saturday, 21 January 2017 at 12:33:57 UTC, albert-j wrote:
Now I dmd -profile it and look at the performance of funcA with
d-profile-viewer. Inside funcA, only 20% of time is spend in
funcB, but the rest 80% is self-time of funcA. How is it
possible, when funcB has three times the calculatio
On Wednesday, 18 January 2017 at 23:08:07 UTC, Adam D. Ruppe
wrote:
On Wednesday, 18 January 2017 at 22:57:22 UTC, NotSpooky wrote:
Is it undefined behavior to assign &this to a pointer in the
constructor of a struct?
Yes:
http://dlang.org/spec/struct.html
"A struct is defined to not have an
On Tuesday, 17 January 2017 at 23:41:27 UTC, Nordlöw wrote:
On Tuesday, 17 January 2017 at 23:38:46 UTC, Ali Çehreli wrote:
Found'em! :)
https://dlang.org/phobos/std_math.html#.nextUp
Thanks!
(Shouts into the soundless void)
https://github.com/pineapplemachine/mach.d/blob/master/mach/mat
On Wednesday, 18 January 2017 at 00:09:42 UTC, Nordlöw wrote:
What's the easiest way to print a double in maximum precision?
https://github.com/pineapplemachine/mach.d/blob/master/mach/text/numeric/floats.d#L60
You can also try the formatting directive "%.20f" but unlike the
former I can't of
On Tuesday, 17 January 2017 at 00:08:24 UTC, Nordlöw wrote:
How do I best initialize a D double to an exact mantissa and
exponent representation?
I'm specifically interested in
2^^i for all i in [min_exp, max_exp]
This mach module can do the job:
https://github.com/pineapplemachine/mach
On Monday, 16 January 2017 at 09:33:23 UTC, Nestor wrote:
PS. Isn't this approach considered "cheating" in quines? ;)
I'm afraid so - while the empty program has been technically
accepted as being a quine (e.g.
http://www.ioccc.org/1994/smr.hint) programs which use file io to
read their own
On Sunday, 15 January 2017 at 21:37:53 UTC, Nestor wrote:
Any ideas for a shorter version (preferably without using
pointers)?
When compiling with the -main flag, this D program is a quine:
On Friday, 6 January 2017 at 06:24:12 UTC, rumbu wrote:
I'm not sure if this works quite as intended, but I was at
least able to produce a UTF-16 decode error rather than a
UTF-8 decode error by setting the file orientation before
reading it.
import std.stdio;
import core.stdc.wchar
On Wednesday, 4 January 2017 at 19:20:31 UTC, Nestor wrote:
On Wednesday, 4 January 2017 at 18:48:59 UTC, Daniel Kozák
wrote:
Ok, I've done some testing and you are right byLine is broken,
so please fill a bug
A bug? I was under the impression that this function was
*intended* to work only wi
On Wednesday, 28 December 2016 at 02:08:44 UTC, Guy Asking a
Question wrote:
import test; <---dmd choking here.
You will need to use the -I option of dmd/rdmd to inform the
compiler of where your `HopefullySomeDLibrary` directory is
located, as well as any other places you will want to import
On Monday, 19 December 2016 at 09:24:38 UTC, Ali wrote:
Ok so laziness stops as soon as sort is required on a range
then? Ahh, because in place algorithms? Are there any plans in
D to make is to that you can output copies to collections so
that you could do something like filter.transpose.sort
On Thursday, 10 November 2016 at 16:47:30 UTC, Adam D. Ruppe
wrote:
On Thursday, 10 November 2016 at 16:41:56 UTC, Charles Hixson
wrote:
It's *supposed* to be nan, and the assert message reports that
it is, but it should pass the assert test, not throw an
assertion. What am I doing wrong?
Ho
On Wednesday, 2 November 2016 at 14:24:42 UTC, Andrea Fontana
wrote:
On Wednesday, 2 November 2016 at 14:05:50 UTC, pineapple wrote:
I'm trying to do some math stuff with std.bigint and realized
there's no obvious way to calculate the ceil of log2 of a
bigint. Help?
How big are your bigints?
I'm trying to do some math stuff with std.bigint and realized
there's no obvious way to calculate the ceil of log2 of a bigint.
Help?
On Thursday, 27 October 2016 at 22:17:35 UTC, WhatMeWorry wrote:
I'm using Derelict GLFW3 and I found the following GLFW3 code
snippet in a demo.
In a small demo, crap like this usually isn't a big deal.
It's not common practice, though, and for good reason. You should
definitely avoid imit
On Tuesday, 11 October 2016 at 07:55:36 UTC, orip wrote:
I get "Error: mismatched function return type inference" errors
with choosing the return type for functions that work on ranges
using, e.g, std.algorithm or std.range functions, but have
different behavior based on runtime values. The ret
On Thursday, 6 October 2016 at 09:17:08 UTC, pineapple wrote:
On Wednesday, 5 October 2016 at 19:30:01 UTC, Jonathan M Davis
wrote:
Would just like to point out that this is design weirdness on
Phobos' part - the library I've been writing does not have
this problem.
It doesn't even make conce
On Wednesday, 5 October 2016 at 19:30:01 UTC, Jonathan M Davis
wrote:
Would just like to point out that this is design weirdness on
Phobos' part - the library I've been writing does not have
this problem.
It doesn't even make conceptual sense for a static array to be
a range, because you can'
On Wednesday, 5 October 2016 at 18:19:27 UTC, TheGag96 wrote:
On Wednesday, 5 October 2016 at 02:19:13 UTC, Jonathan M Davis
wrote:
The problem is that static arrays aren't ranges (calling
popFront on them can't work, because their length isn't
mutable). However, you can slice a static array to
On Monday, 3 October 2016 at 19:25:59 UTC, Uranuz wrote:
When I pass empty string to splitter in most of languages I
expect to get list with 1 item (empty string) as a result, but
I get error instead. And I see inconsistency in that .front
behaves normally, but .back is not. Usually I access fr
On Saturday, 1 October 2016 at 17:55:08 UTC, Uranuz wrote:
On Saturday, 1 October 2016 at 17:32:59 UTC, Uranuz wrote:
On Saturday, 1 October 2016 at 17:23:16 UTC, Uranuz wrote:
[...]
But these example fails. Oops. Looks like a bug(
import std.stdio;
import std.algorithm;
import std.range;
im
On Saturday, 1 October 2016 at 14:43:31 UTC, Adam D. Ruppe wrote:
On Saturday, 1 October 2016 at 14:41:22 UTC, Andrew wrote:
Is there any way to get the system date at compile time.
Not exactly, but the special symbol __TIMESTAMP__ gets a string
out of the compiler at build time.
http://dla
I'd really like to define my own types that accept indexes for
opIndex and opSlice as template arguments. Is there any way to do
this? If not, this seems like an obvious thing to add to the
language - what's been holding it back?
On Sunday, 25 September 2016 at 16:07:59 UTC, Basile B. wrote:
WooW I have to say that I'm mesmerized !
How can this works ? "member" is run time variable so the
return type shouldn't be inferable.
The int fields are promoted to and returned as floats.
On Sunday, 25 September 2016 at 04:54:31 UTC, grampus wrote:
Dear all
For example, I have a struct
struct point{int x;int y}
point a;
Is there an easy way to access x and y by using a["x"] and
a["y"]
I guess I need to overload [], but can't figure out how.
Someone can help? Thank you very m
On Saturday, 10 September 2016 at 14:24:23 UTC, ag0aep6g wrote:
On 09/10/2016 04:10 PM, pineapple wrote:
I've got a struct and it would be very convenient if I could
specify
what happens when I write `if(value)` - is this possible?
`if (value)` implies a cast to bool. Define opCast!bool and i
I've got a struct and it would be very convenient if I could
specify what happens when I write `if(value)` - is this possible?
On Friday, 9 September 2016 at 11:54:42 UTC, Steven Schveighoffer
wrote:
Can you demonstrate the issue? I have never heard of this.
imports should work when done inside a function.
-Steve
Tried and failed to reproduce with a simple example, but any time
I've tried doing it in the code I'm wo
On Friday, 9 September 2016 at 09:43:15 UTC, O-N-S wrote:
On Friday, 9 September 2016 at 09:31:54 UTC, pineapple wrote:
On Friday, 9 September 2016 at 08:25:40 UTC, rikki cattermole
wrote:
TLDR: no you cannot do what you were thinking.
Seems like something one ought to be able to do, though.
On Thursday, 8 September 2016 at 22:13:26 UTC, Steven
Schveighoffer wrote:
I posted an article on this:
http://www.schveiguy.com/blog/2016/03/import-changes-in-d-2-071/
-Steve
Regarding that article:
Another import-related bug fix is to prevent unintentional
hijacking of symbols inside a sc
On Friday, 9 September 2016 at 08:25:40 UTC, rikki cattermole
wrote:
TLDR: no you cannot do what you were thinking.
Seems like something one ought to be able to do, though. DIP time?
On Wednesday, 7 September 2016 at 20:29:42 UTC, jmh530 wrote:
Thanks for the reply. It looks like an interesting idea. You
might consider adding this (or a modified version) to a read me
in the range subfolder.
Fuck it, I took an hour to document the most significant modules.
https://github.c
On Wednesday, 7 September 2016 at 18:22:39 UTC, jmh530 wrote:
On Wednesday, 7 September 2016 at 18:10:45 UTC, pineapple wrote:
You might want to check out the ranges package of the library
I'm working on.
https://github.com/pineapplemachine/mach.d/tree/master/mach/range
There's a lot of s
On Tuesday, 6 September 2016 at 14:38:54 UTC, Russel Winder wrote:
and I have no idea just now why it is complaining, nor what to
do to fix it.
You might want to check out the ranges package of the library I'm
working on.
https://github.com/pineapplemachine/mach.d/tree/master/mach/range
Thi
On Monday, 5 September 2016 at 17:33:17 UTC, pineapple wrote:
Am I missing something or is this an obnoxious bug with the GC?
Oh, I've been trying to figure this out on and off for days and
of course five minutes after I post I fix the problem. I'm not
really sure why, but it did fix it.
In
I have a program which I have stripped down to a single offending
line which, when present in my program, causes an invalid memory
operation to occur after main has evaluated:
import mach.sdl.window;
void main(){
auto win = new Window(300, 300);
}
The program is a bit large
On Monday, 5 September 2016 at 15:43:52 UTC, Lodovico Giaretta
wrote:
On Monday, 5 September 2016 at 15:20:10 UTC, pineapple wrote:
I'd like to be able to write something like this, but I
haven't been able to find anything in the docs
class Base{}
class Sub: Base{}
static assert(is
I'd like to be able to write something like this, but I haven't
been able to find anything in the docs
class Base{}
class Sub: Base{}
static assert(is(SuperClassOf!Sub == Base));
This program does not compile.
Error: cannot implicitly convert expression (cast(int)x -
cast(int)x) of type int to ubyte
void main(){
ubyte x;
x = x - x;
}
I don't even know what to say. Who thought this behavior was a
good idea?
On Saturday, 3 September 2016 at 09:30:58 UTC, Darren wrote:
Thanks for the information. The errors for the tutorial I
_was_ trying to make work are as follows:
source\app.d(9,5): Error: undefined identifier 'Window', did
you mean variable 'window'?
source\app.d(98,12): Error: undefined ident
On Wednesday, 31 August 2016 at 14:03:20 UTC, Yuxuan Shui wrote:
I want to make a hash table that uses std.experiment.allocator.
The bucket is allocated from an allocator, and freed in
~this(). I don't want to copy the whole bucket in this(this).
Maybe I should use a reference counter or somet
On Wednesday, 31 August 2016 at 07:40:39 UTC, Dorian Haglund
wrote:
Hello,
I have an array of objects of class C which contain a id member.
I want to figure out if all the id members are unique using
functional primitives.
For example, if I have:
class C
{
int id;
}
and an array of C 'Cs'
I would just love if I could express this as something more like
context(auto file = File("some_file.txt")){
file.write();
}
On Friday, 26 August 2016 at 23:30:15 UTC, Cauterite wrote:
On Friday, 26 August 2016 at 23:28:27 UTC, pineapple wrote:
I've grown to very much appreciate how context initialization
and teardown can be very conveniently handled using `with` in
Python. Is there any clean way to imitate this synt
I've grown to very much appreciate how context initialization and
teardown can be very conveniently handled using `with` in Python.
Is there any clean way to imitate this syntax in D?
On Thursday, 18 August 2016 at 11:43:03 UTC, Lodovico Giaretta
wrote:
On Thursday, 18 August 2016 at 11:11:10 UTC, mogu wrote:
On Thursday, 18 August 2016 at 10:45:14 UTC, Lodovico Giaretta
wrote:
Which kind of error? An error message by the compiler? One by
the linker? The compiler crashes?
On Wednesday, 10 August 2016 at 23:32:54 UTC, WhatMeWorry wrote:
Afterall, isn't that the definition of a string? So what's up
with the two groupings of single quotes?
http://www.howtogeek.com/howto/29980/whats-the-difference-between-single-and-double-quotes-in-the-bash-shell/
On Sunday, 31 July 2016 at 18:57:50 UTC, Jack Stouffer wrote:
Next question: what's the fastest hashing implementation that
will provide the least collisions? Is there a hash
implementation that's perfered for AAs?
There's no hashing function that would be specifically better for
associative
On Saturday, 30 July 2016 at 12:54:32 UTC, Basile B. wrote:
func is a pointer to a function but FunctionTypeOf extracts the
target type.
So the correct assertion is
static assert(is(FunctionTypeOf!func* == typeof(func)));
I can't believe that it worked for delegates because the same
happe
This failure seems curious and I haven't been able to understand
why it occurs, or whether it might be intentional. For all other
callable types, including functions and delegates and types
implementing opCall, the assertion passes.
import std.traits : FunctionTypeOf;
void function() f
On Friday, 29 July 2016 at 12:22:54 UTC, Andre Pany wrote:
It is more or less syntax sugar. In the main function instead
of writing "mixin(generateCode(s));" I want to write "foo(s);".
So, the mixin statement is hidden while the functionality of
mixin stays.
Kind regards
André
As far as I k
On Friday, 29 July 2016 at 06:38:17 UTC, Andre Pany wrote:
Hi,
is there a way to alias a string mixin?
Neither foo nor foo2 compiles.
import std.meta : Alias;
alias foo = (s) => Alias!(mixin(generateCode(s)));
alias foo2(string s) = Alias!(mixin(generateCode(s)));
string generateCode(string s)
On Thursday, 28 July 2016 at 21:49:00 UTC, pineapple wrote:
On Thursday, 28 July 2016 at 20:28:39 UTC, jdfgjdf wrote:
"Parameters!dgref.init" does not yield a reference. The real
error is not displayed. In a normal context it would be "stuff
is not callable with"
What would be a better wa
On Thursday, 28 July 2016 at 20:28:39 UTC, jdfgjdf wrote:
"Parameters!dgref.init" does not yield a reference. The real
error is not displayed. In a normal context it would be "stuff
is not callable with"
What would be a better way to check whether some callable can be
called using a param
Why doesn't this code do what I'd expect it to, and how can I fix
it?
unittest{
import std.traits : Parameters;
// Works as expected
alias dg = int delegate(int value);
enum bool dgcallable =
is(typeof((){dg(Parameters!dg.init);}));
pragma(msg, dgcal
On Wednesday, 20 July 2016 at 18:32:15 UTC, Jesse Phillips wrote:
I think you mean that your range library treats them as arrays
of code units, meaning your library will break (some) unicode
strings.
Right - I disagree with the assessment that all (or even most)
char[] types are intended to r
On Wednesday, 20 July 2016 at 16:04:50 UTC, pineapple wrote:
On Wednesday, 20 July 2016 at 16:03:27 UTC, pineapple wrote:
On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
There is no auto-decoding going on here, as char[] and
wchar[] are rejected outright since they are not consid
On Wednesday, 20 July 2016 at 16:03:27 UTC, pineapple wrote:
On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
There is no auto-decoding going on here, as char[] and wchar[]
are rejected outright since they are not considered random
access ranges.
They are considered random acces
On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
There is no auto-decoding going on here, as char[] and wchar[]
are rejected outright since they are not considered random
access ranges.
They are considered random access ranges by my ranges library,
because they are treated as ar
On Wednesday, 20 July 2016 at 08:02:07 UTC, Mike Parker wrote:
You can then go to the documentation for
std.range.primitives.isRandomAccessRange [2], where you'll find
the following:
"Although char[] and wchar[] (as well as their qualified
versions including string and wstring) are arrays,
i
On Sunday, 17 July 2016 at 01:57:21 UTC, pineapple wrote:
On Saturday, 16 July 2016 at 22:05:49 UTC, ketmar wrote:
actually, `foreach (v; rng)` looks like `foreach` is *reusing*
*existing* *variable*. most of the time you can put
`immutable` or something like that there to note that it is
not
On Saturday, 16 July 2016 at 22:05:49 UTC, ketmar wrote:
actually, `foreach (v; rng)` looks like `foreach` is *reusing*
*existing* *variable*. most of the time you can put `immutable`
or something like that there to note that it is not reusing
(purely cosmetical thing), but sometimes you cannot
I was surprised when this didn't work. What's the rationale? Is
there any better workaround than renaming methods?
interface A{
void foo();
final void foo(int x){}
}
class B: A{
void foo(){}
}
void main(){
auto b = new B();
b.foo();
On Sunday, 10 July 2016 at 21:20:34 UTC, Basile B. wrote:
The problem you encounter here is that templatized functions
cannot be virtual. If you remove "abstract" and put an empty
body than it works, but you lose the whole OOP thing, i.e you
cannot call the most derived override from the base.
This is essentially what I'm trying to accomplish. The intuitive
solution, of course, does not work. In theory I could write a
separate method for every anticipated return type, but that would
be horrible and in that case I'd probably just write the damn
thing in a dynamically-typed language in
On Thursday, 7 July 2016 at 03:52:40 UTC, Jonathan M Davis wrote:
However, it looks like you can combine those two types of
variadic functions to get more or less what you want (albeit
more verbosely). e.g.
template isInt(T) { enum isInt = is(std.traits.Unqual!T ==
int); }
void test(Args..
I'd like to do something like this but it doesn't seem to be
legal -
void test(int[] ints...) if(ints.length){
// stuff
}
Not being able to specify this interferes with how I'd like to
define my method overloads. What's the best way to achieve what
I'm looking for?
There are suffixes for numbers like 0L, 0u, 0f, 0d, etc. What
about suffixes representing size_t and ptrdiff_t? Do they exist?
If not, why?
Here's a simple code example to illustrate what I expected to
work and didn't - is this a mistake in my syntax or a limitation
of the language?
template SomeTemplate(alias func){
auto templatefunc(T)(int x){
return func!T(x);
}
}
// Valid
auto somefu
On Tuesday, 14 June 2016 at 07:35:36 UTC, Andrea Fontana wrote:
Simply:
method2();
Also, typeof(this).method2();
On Monday, 13 June 2016 at 22:54:13 UTC, Ali Çehreli wrote:
Tree!T tree(TL, T, TR)(TL left, T node, TR right) {
return new Tree!T(left, node, right);
}
There's also this:
Tree!T tree(TL, T, TR)(TL left, T node, TR right) if(
(is(TL == Tree!T) || is(TL == typeof(null))) &&
On Saturday, 4 June 2016 at 15:43:01 UTC, Mihail K wrote:
As far as I recall, foreach_reverse is deprecated in favour of
range operations.
ie.
import std.algorithm, std.range;
static if(forward)
{
items.each!(item => doStuff());
}
else
{
items.retro.each!(item => doStuf
It would be fantastic if I could write this -
static if(forward){
foreach(item; items) dostuff();
}else{
foreach_reverse(item; items) dostuff();
}
as something like this -
foreach!forward(item; items) dostuff();
Is there any way to accomplish this?
How this could possibly be happening is confounding me and I have
no idea if it's something I missed or some contrived compiler bug.
This is the package.d that previously I've compiled with unittest
every so often as a way of doing regression testing -
https://github.com/pineapplemachine/mach.
On Tuesday, 31 May 2016 at 20:46:37 UTC, Basile B. wrote:
Yes this can be done, you must use the getOverload trait:
https://dlang.org/spec/traits.html#getOverloads
The result of this trait is the function itself so it's not
hard to use, e.g the result can be passed directly to
'Parameters', '
I'd like to find the overload of some function with the most
parameters and (in this specific case) to get their identifiers
using e.g. ParameterIdentifierTuple. There have also been cases
where I'd have liked to iterate over the result of
Parameters!func for each overload of that function. Can
Here's one more vote for extending UFCS to operator overloading.
Elie wrote that it's "a restriction that seems pointless and
arbitrary"... which summarizes my own thoughts rather well, too.
There are certainly concerning scenarios that can arise from
making this change, but the correct way to
On Monday, 30 May 2016 at 16:22:26 UTC, Max Samukha wrote:
From the spec (https://dlang.org/spec/function.html#nested):
"Nested functions cannot be overloaded."
Anybody knows what's the rationale?
I'm guessing it's related to -
Unlike module level declarations, declarations within function
On Sunday, 29 May 2016 at 19:52:37 UTC, Basile B. wrote:
Do yo have a simple, concise runnable example to show ?
This is the example I was using to test solutions, it's similar
to where I encountered the problem in the first place
import core.stdc.stdlib : malloc, free;
import std.st
On Sunday, 29 May 2016 at 18:52:36 UTC, pineapple wrote:
What's the best way to handle something like this?
Well I did get something to work but it's ugly and I refuse to
believe there isn't a better way to handle this.
Where `Range` is an alias to a struct with an immutable member,
and `th
I found another post on this subject and the advice there was
"don't put const members in your structs" -
http://forum.dlang.org/thread/m87ln2$idv$1...@digitalmars.com
This doesn't work out so well when the templated struct is
referring to what happens to be a const array.
I thought I could
On Saturday, 28 May 2016 at 16:25:02 UTC, Seb wrote:
If you are interested how it works under the hood - it's pretty
simple & elegant:
I checked up on the phobos implementation and found that arrays
are mutated when iterated over as ranges, which didn't rest well
with me. Nor did the idea of
I'm writing my own map function modeled after the one in phobos.
(because I feel like it, that's why. good learning experience.)
I've encountered one remarkable difference: The phobos function
accepts arrays and mine does not. I understand why - I'm calling
methods that arrays don't have - but
1 - 100 of 149 matches
Mail list logo