On Thursday, 4 August 2022 at 01:32:15 UTC, Salih Dincer wrote:
I guess I wrote the following anything like that you want.
```d
void main()
{
import std.bigint,
std.string : representation;
BigInt i = 1001;
auto val = i.to!(dchar[]);
assert(val.representation == [49, 48, 48, 4
On Thursday, 4 August 2022 at 01:05:31 UTC, H. S. Teoh wrote:
Don't call .toString directly. Instead, use std.format.format:
```d
import std;
void main() {
auto x = BigInt("123123123123123123123123123123123123");
string s = format("%s", x); // this gives you the string
representation
On Thursday, 4 August 2022 at 00:45:44 UTC, Ruby The Roobster
wrote:
How exactly can one store the string representation of a
BigInt? The seemingly obvious:
dchar[] is necessary for my project.
Assume that val is a BigInt with
a value set earlier:
```d
val.toString(ret, "%d");
```
doesn't work.
On Thu, Aug 04, 2022 at 12:45:44AM +, Ruby The Roobster via
Digitalmars-d-learn wrote:
> How exactly can one store the string representation of a BigInt? The
> seemingly obvious
>
> ```d
> //...
> dchar[] ret; //dchar[] is necessary for my project
> //Assume that val is a BigInt with a value
On Thu, Aug 04, 2022 at 12:35:55AM +, Alex Burton via Digitalmars-d-learn
wrote:
> Hi,
> I want to use MmFile to manage memory mapped files. I want multiple
> processes to be able to read in many files using the virtual memory
> system to page them in and reuse the memory.
>
> If I read the c
How exactly can one store the string representation of a BigInt?
The seemingly obvious
```d
//...
dchar[] ret; //dchar[] is necessary for my project
//Assume that val is a BigInt with a value set earlier:
val.toString(ret, "%d");
//...
```
doesn't work. I am using x86_64 windows with -m64, an
Hi,
I want to use MmFile to manage memory mapped files. I want
multiple processes to be able to read in many files using the
virtual memory system to page them in and reuse the memory.
If I read the contents of the file, I can cast it to immutable
and then I get segfaults when accessing the d
On Wednesday, 3 August 2022 at 19:11:51 UTC, pascal111 wrote:
On Wednesday, 3 August 2022 at 18:53:35 UTC, jfondren wrote:
On Wednesday, 3 August 2022 at 18:33:37 UTC, pascal111 wrote:
I changed it to "x=notfunny(x);" and has the same result.
Now you are changing the value of the temporary lo
On Wednesday, 3 August 2022 at 19:11:51 UTC, pascal111 wrote:
On Wednesday, 3 August 2022 at 18:53:35 UTC, jfondren wrote:
On Wednesday, 3 August 2022 at 18:33:37 UTC, pascal111 wrote:
I changed it to "x=notfunny(x);" and has the same result.
Now you are changing the value of the temporary lo
On Wednesday, 3 August 2022 at 18:53:35 UTC, jfondren wrote:
On Wednesday, 3 August 2022 at 18:33:37 UTC, pascal111 wrote:
I changed it to "x=notfunny(x);" and has the same result.
Now you are changing the value of the temporary loop variable
that is still immediately discarded afterwards.
On Wednesday, 3 August 2022 at 18:33:37 UTC, pascal111 wrote:
I changed it to "x=notfunny(x);" and has the same result.
Now you are changing the value of the temporary loop variable
that is still immediately discarded afterwards.
You should return a new range that has the values you want, no
On Wednesday, 3 August 2022 at 18:25:50 UTC, jfondren wrote:
On Wednesday, 3 August 2022 at 17:33:40 UTC, pascal111 wrote:
On Wednesday, 3 August 2022 at 17:09:11 UTC, jfondren wrote:
On Wednesday, 3 August 2022 at 16:59:53 UTC, pascal111 wrote:
I tried to make a template that receive lambda ex
On Wednesday, 3 August 2022 at 17:33:40 UTC, pascal111 wrote:
On Wednesday, 3 August 2022 at 17:09:11 UTC, jfondren wrote:
On Wednesday, 3 August 2022 at 16:59:53 UTC, pascal111 wrote:
I tried to make a template that receive lambda expression to
apply it on a given range the user specifies, but
On Wednesday, 3 August 2022 at 17:09:11 UTC, jfondren wrote:
On Wednesday, 3 August 2022 at 16:59:53 UTC, pascal111 wrote:
I tried to make a template that receive lambda expression to
apply it on a given range the user specifies, but I found
non-understood problem:
Compare with:
```D
auto fo
On Wednesday, 3 August 2022 at 16:59:53 UTC, pascal111 wrote:
I tried to make a template that receive lambda expression to
apply it on a given range the user specifies, but I found
non-understood problem:
Compare with:
```D
auto foo(Range)(Range range) { // remove isInputRange!T test
...
I tried to make a template that receive lambda expression to
apply it on a given range the user specifies, but I found
non-understood problem:
'''D
module main;
import std.stdio;
import std.functional;
template foo(alias predicate)
if (is(typeof(unaryFun!predicate)))
{
I don't know if this helps but i have to do,
export CC=/usr/local/bin/gcc
with ldc2.
I don't know why it works with gcc but not with llvm/clang.
On Wednesday, 3 August 2022 at 13:00:05 UTC, Paul Backus wrote:
On Wednesday, 3 August 2022 at 12:50:17 UTC, Ruby The Roobster
wrote:
Any way to 'cast away' shared for an unknown type T?
There's actually an `Unshared` template for this in
`std.traits`, but for some reason it's `private`, so y
On Wednesday, 3 August 2022 at 12:50:17 UTC, Ruby The Roobster
wrote:
Any way to 'cast away' shared for an unknown type T?
There's actually an `Unshared` template for this in `std.traits`,
but for some reason it's `private`, so you can't use it directly.
Fortunately, it's only two lines:
``
Any way to 'cast away' shared for an unknown type T?
On Wednesday, 3 August 2022 at 03:36:55 UTC, Domain wrote:
I want to find out all public functions in all modules in a
package. Can I do that at compile time?
You can do something like that:
```d
static foreach (sym; __traits(allMembers, mixin("std.string")))
{
pragma(msg, sym.stringof);
}
On Wednesday, 3 August 2022 at 03:36:55 UTC, Domain wrote:
I want to find out all public functions in all modules in a
package. Can I do that at compile time?
No, D packages are not closed; anyone can add new modules to them
at any time.
On Wednesday, 3 August 2022 at 03:36:55 UTC, Domain wrote:
I want to find out all public functions in all modules in a
package. Can I do that at compile time?
I think it's not possible.
On Wednesday, 3 August 2022 at 09:39:36 UTC, ryuukk_ wrote:
Does adding ```-m64``` work
I'm using macOS so I don't think that applies. But no, it doesn't
do anything for me.
Thanks,
--anonymouse
Does adding ```-m64``` work
leyts try very rough simlified concept:
template itself - is compile-time program (parameterizable), it
can generate some code for you.
template instantiation (like "calling") with "!" - instruct
compiler to "start this compile-time program here with this
parameters".
26 matches
Mail list logo