I *strongly* believe the answer is not reasonable using phoboes
tools; but Im going to leave it as an open question before I get
started on something from scratch.
Given well compliant phoboes-style ranges and a `ref string or
retro!string` that starts with '(',')','[',']','{','}', modify
tha
On Friday, 20 September 2024 at 09:38:54 UTC, Dakota wrote:
I need my struct defined as `isZeroInit`, so can I can import
them as `di` file. (this also reduce build size)
But I find this problem with float inside union:
```d
struct test_t {
union {
int i32;
float f32;
On Wednesday, 11 September 2024 at 22:06:54 UTC, WB wrote:
I feel there is too much already in D and standard library, and
things are added to quickly and eagerly, and years later we end
up in a mess that cannot be solved (because of compatibility).
this isnt autodecoding, cant be, your oping
On Monday, 9 September 2024 at 20:52:09 UTC, WraithGlade wrote:
This is not that surprising considering it uses hardcoded
numbers and doesn't look right.
I made it on dlang.io which does space tabs, if its not ovisous
to a beginner, parse is ~~lazy~~ not correct, it need to do find
substrin
On Monday, 9 September 2024 at 19:29:01 UTC, Salih Dincer wrote:
My only concern is why i == 5 in the line below when i == 28?
i isn't being modified by a `*=`. its only the two ++
On Monday, 9 September 2024 at 17:39:46 UTC, WraithGlade wrote:
import std;
auto parse(char[] s)=>s[9..$-2];
void show(T,string file= __FILE__,int line=__LINE__)(T t){
writeln(File(file).byLine.drop(line-1).front.parse," == ",t);
}
void main(){
int i=3;
show(i++ + ++i * i);
sho
On Monday, 9 September 2024 at 00:34:03 UTC, Paul Backus wrote:
The only way
is that a challenge?
void main()
{
import std.stdio;
mixin(show!"1 + 2"); // 1 + 2 == 3
const int x = 1 + 2;
mixin(show!"x"); // x == 3
}
```
idk why you calling it a macro, im pretty sure d isnt
On Sunday, 8 September 2024 at 22:01:10 UTC, WraithGlade wrote:
I want to just be able to write this:
```
show!(1 + 2)
```
```d
void show(string s)(){
auto res=mixin(s);
writeln(s,"==",res);
}
show!"1+2";
```
On Tuesday, 3 September 2024 at 11:57:42 UTC, remontoir wrote:
Not really sure what is happening here.
This works is "None" is removed, but displays a silly answer or
fails with "range is smaller than amount of items to pop"
otherwise.
I guess it is related to enum being also integers ?
```d
On Sunday, 1 September 2024 at 11:01:13 UTC, kdevel wrote:
In order to make this work
```d
import std.typecons;
alias vstring = Typedef!string;
void main ()
{
import std.stdio;
import std.conv;
auto v = 3.to!vstring; // ain't work out of the box
writeln (v);
auto w = 3.to!stri
On Wednesday, 28 August 2024 at 19:08:58 UTC, Sergey wrote:
In Discord we are collecting all links about different topics.
We already have D & Wasm topic with most of the relevant links.
airnt all the wasm projects by people not on the discord?
On Friday, 23 August 2024 at 05:50:43 UTC, Dakota wrote:
any suggestions how to fix this?
```sh
/ldc/bin/../import/core/stdc/stdio.d(31): Error: module ```
I dont use the std with wasm, everything imports everything else
and there are just broken symbols deep in "core" that wont be
fixed
On Thursday, 22 August 2024 at 07:28:00 UTC, Dakota wrote:
Is there a way to link ldc objects with Emscripten to build
wasm binary ?
yes; you'll have to untangle my build system
https://github.com/crazymonkyyy/raylib-2024
It will always suck tho
On Saturday, 17 August 2024 at 06:11:58 UTC, Bruce wrote:
On Saturday, 17 August 2024 at 05:42:42 UTC, monkyyy wrote:
On Saturday, 17 August 2024 at 05:28:37 UTC, Bruce wrote:
It's the correct name for the wrong function
Are you saying this is wrong?
auto i = arr.countUntil("ha");
yes
```d
On Saturday, 17 August 2024 at 05:28:37 UTC, Bruce wrote:
This seems to work but now I'm concerned.
Why was it so hard to find?
What is the best way to search for a function
in the Phobos library?
It's the correct name for the wrong function
If you use it on unicode strings or filters it's ju
On Thursday, 18 July 2024 at 12:25:37 UTC, Dakota wrote:
I am trying to translate some c code into d, get this error:
```d
struct A {
void* sub;
}
struct B {
void* subs;
}
__gshared {
const A[1] a0 = [
{ &b1_ptr },
];
const A[2] a1 = [
On Tuesday, 9 July 2024 at 20:03:15 UTC, kiboshimo wrote:
On Tuesday, 9 July 2024 at 14:42:01 UTC, monkyyy wrote:
On Tuesday, 9 July 2024 at 07:54:12 UTC, kiboshimo wrote:
- betterC can be compiled to WASM, but some of phobos can't,
so basically same worries as above. I'm afraid to lose some
e
On Tuesday, 9 July 2024 at 07:54:12 UTC, kiboshimo wrote:
I'm going to try a project with raylib and WASM.
use mine
https://github.com/crazymonkyyy/raylib-2024/blob/master/docs/examplecode.md
- betterC can be compiled to WASM, but some of phobos can't, so
basically same worries as above. I'm
On Monday, 1 July 2024 at 13:00:55 UTC, ryuukk_ wrote:
i don't want string concatenation
This limitation is very intentional, add it to the pile like file
io in ctfe of stuff that the core devs think "you shouldnt even
want that" for "safety"
On Sunday, 23 June 2024 at 16:33:54 UTC, realhet wrote:
Hi,
Is there a way to call an external program from CTFE?
Use case:
Inside a module I want to put some GLSL code.
I also want to generate that GLSL code using CTFE.
And when it's done, it would be nice if I was able to save that
GLSL cod
On Wednesday, 12 June 2024 at 16:50:04 UTC, Vinod K Chandran
wrote:
On Wednesday, 12 June 2024 at 01:35:26 UTC, monkyyy wrote:
rather then worring about the gc, just have 95% of data on the
stack
How's that even possible ? AFAIK, we need heap allocated memory
in order to make GUI lib as a D
On Tuesday, 11 June 2024 at 17:15:07 UTC, Vinod K Chandran wrote:
On Tuesday, 11 June 2024 at 16:54:44 UTC, Steven Schveighoffer
wrote:
I would instead ask the reason for wanting to write D code
without the GC.
-Steve
Hi Steve,
Two reasons.
1. I am writting a dll to use in Python. So I am
On Sunday, 9 June 2024 at 07:11:22 UTC, Eric P626 wrote:
On Saturday, 8 June 2024 at 21:04:16 UTC, monkyyy wrote:
generate is a very rare function and do novices understand
lamdas?
Yes I know lamdas, but try not to use them.
I am not very picky about the exact source of time, I just want
a d
On Saturday, 8 June 2024 at 20:53:02 UTC, Nick Treleaven wrote:
On Saturday, 8 June 2024 at 16:09:04 UTC, monkyyy wrote:
rng is an optional parameter, `uniform(0,100).writeln;` alone
works; the docs not telling you that is really bad
They do tell you:
urng (optional) random number generator
On Saturday, 8 June 2024 at 13:19:30 UTC, Eric P626 wrote:
I managed to create a random number generator using the
following code:
~~~
auto rng = Random(42);
//
uniform(0,10,rng);
~~~
Now I want to seed the generator using system time. I looked at
Date & time functions/classes and systime
On Sunday, 21 April 2024 at 08:44:38 UTC, alex wrote:
Hi guys. Trying to play with vibe-d and want to create separate
web app, and cli app which can add admin users. When I just
keep both files app.d and cli.d in source folder, I get an
error that I can't have more then 1 main function.
[...]
On Friday, 12 April 2024 at 03:57:40 UTC, John Dougan wrote:
Not every day you get to blame a compiler bug.
D is uniquely: hacky, expressive and buggy.
Having more metaprograming then c++ without the raw man power
comes at a cost, in d you should distrust the spec and instead
see what the
On Friday, 22 March 2024 at 02:19:07 UTC, Liam McGillivray wrote:
In the [game I am currently
making](https://github.com/LiamM32/Open_Emblem/blob/master/oe-raylib/source/app.d), I have a `Map` class (actually a combination of an interface & class template, but I'll call it a "class" for simplicit
On Friday, 15 March 2024 at 20:36:56 UTC, rkompass wrote:
I start to see that D is heavily influenced by C++ (STL), not
just C.
This is not bad
It is just bad; ranges are not pairs of 2 pointers, stepov was
comprising with c++ or if he thinks c++ iterators are objectively
good(not good fo
On Friday, 15 March 2024 at 09:03:25 UTC, rkompass wrote:
@Monkyyy: I adopted your solution, it is perfect.
I only have one problem left:
The foreach loop with associative arrays has two cases:
`foreach(key, val; arr)` and `foreach(x; arr)`.
In the second case only the values are iterated.
Wit
On Thursday, 14 March 2024 at 17:57:21 UTC, Andy Valencia wrote:
Can somebody give me a starting point for understanding varadic
functions? I know that we can declare them
int[] args...
and pick through whatever the caller provided. But if the
caller wants to pass two int's and a _string_
On Thursday, 14 March 2024 at 16:32:10 UTC, rkompass wrote:
On Thursday, 14 March 2024 at 16:12:00 UTC, rkompass wrote:
Hello @monkyyy again,
your solution is much more elegant:-) No need to do a deep copy.
I was thinking about a way to achieve that but had no clue.
I will study opSlice now.
Y
On Wednesday, 13 March 2024 at 22:16:52 UTC, rkompass wrote:
I want to make a custom dictionary that I may iterate through
with foreach. Several times.
What I observe so far is that my dict as a simple forward range
is exhausted after the first foreach and I have to deeply copy
it beforehand.
On Friday, 1 March 2024 at 05:07:24 UTC, Liam McGillivray wrote:
I don't know how best to organize the code. So far I have been
oo ideas
for a 2nd opinion:
https://github.com/crazymonkyyy/raylib-2024/blob/master/docs/examplecode.md
Theres not a good learning resource but "data oirented desig
On Thursday, 18 January 2024 at 02:55:37 UTC, zjh wrote:
Can you change the type of 'length' from 'ulong' to 'int', so I
haven't to convert it every time!
The devs are obviously very very wrong here I underflow indexs
all the time
But this is a pretty dead fight, I'd aim for a smart index ty
On Sunday, 28 January 2024 at 16:16:34 UTC, Olivier Pisano wrote:
On Sunday, 28 January 2024 at 08:55:54 UTC, zjh wrote:
On Sunday, 28 January 2024 at 06:34:13 UTC, Siarhei Siamashka
wrote:
The explicit conversion `.length.to!int` has an extra benefit
I rarely use numbers over one million.
On Saturday, 20 January 2024 at 15:59:59 UTC, Anonymouse wrote:
I remember reading this was an issue and now I ran into it
myself.
```d
import std.stdio;
void main()
{
auto names = [ "foo", "bar", "baz" ];
void delegate()[] dgs;
foreach (name; names)
{
dgs ~= () => wri
On Thursday, 11 January 2024 at 11:21:39 UTC, Sergey wrote:
On Thursday, 11 January 2024 at 08:57:43 UTC, Christian Köstlin
wrote:
Did someone already try to do this in dlang?
I guess it will be very hard to beat the java solutions
running with graalvm!
https://news.ycombinator.com/item?id=38
On Saturday, 30 December 2023 at 00:47:04 UTC, Agent P. wrote:
Hello everyone,
I'm looking for a 2D game engine for Dlang that offers
flexibility but has a high-level interface, preferably less
verbose. Although I've explored options on GitHub and in
general, I haven't found something that ex
On Wednesday, 13 December 2023 at 21:15:47 UTC, Julian Fondren
wrote:
6. statically build against musl and include it in the wasm
binary. Since phobos is slow to change, its libc dependencies
will also be slow to change, and you can work on reducing how
much musl goes into the binary. Musl's
so long term planning on wasm raylib; I want compatibility with
the good parts of the std, the std is causal about using libc
while ldc-wasm half-baked implication is missing a bunch of
basically worthless symbols but given the std is 1 million lines
of code it will be a perennial problem that
raylib has a collection of well-organized but verbose functions
https://www.raylib.com/cheatsheet/cheatsheet.html
looking at draw
colors are named `color` or if part of a gradient `color1` and
`color2`
`posx` and `centerx` are a bit more confusing but it should be
fine
etc.
So I want to make
On Tuesday, 17 October 2023 at 17:27:19 UTC, Joakim G. wrote:
For some reason I cannot remove an element from a DList. I
tried several range approaches but to no avail. I'm a noob.
In the end I did this:
```
private void removeFromWaitingQueue(uint jid) {
auto arr = waitingQueue[].array;
On Tuesday, 21 March 2023 at 17:18:15 UTC, H. S. Teoh wrote:
On Tue, Mar 21, 2023 at 04:57:49PM +, monkyyy via
Digitalmars-d-learn wrote:
My current method of making videos of using raylib to generate
screenshots, throwing those screenshots into a folder and
calling a magic ffmpeg command
My current method of making videos of using raylib to generate
screenshots, throwing those screenshots into a folder and calling
a magic ffmpeg command is ... slow.
Does anyone have a demo or a project that does something smarter
(or willing to do the busy work of finding the right combo of
d
On Tuesday, 10 January 2023 at 19:10:09 UTC, Christian Köstlin
wrote:
On 10.01.23 01:17, Paul wrote:
There is also https://exercism.org/tracks/d with some tasks for
dlang.
Kind regards,
Christian
Its all converted code; worthless
On Tuesday, 10 January 2023 at 00:17:18 UTC, Paul wrote:
I know. Someone's going to say why don't YOU do it:)
https://github.com/crazymonkyyy/dingbats
I could use contributors
On Thursday, 23 June 2022 at 08:12:32 UTC, CrazyMan wrote:
linking
make sure you use the -i flag when compiling
On Monday, 20 June 2022 at 13:20:51 UTC, Steven Schveighoffer
wrote:
And you can also use an inner struct to define overloaded
functions.
I believe templates make a better bandaid
```d
void main(){
template bar(){
void bar_(int){}
void bar_(float){}
49 matches
Mail list logo