On 6/30/23 17:42, Cecil Ward wrote:
> https://dlang.org/spec/hash-map.html#testing_membership in the language
> docs, under associative arrays - 13.3 testing membership. Would anyone
> else care to try that example out as that might be quicker?
I tried it by
1) Putting all the code inside a 'vo
How would I go about graphing time series data (specifically,
candles, moving averages, etc) in D and dynamically updating such
charts?
Thanks,
--anonymouse
On Friday, 30 June 2023 at 19:05:23 UTC, Cecil Ward wrote:
I have code roughly like the following:
dstring str = "name"d;
uint ordinal = (( str in Decls.ordinals ) !is null) ?
Decls.ordinals[ str ] : -1;
struct Decls
{
uint[ dstring] ordinals;
}
//and
Decls.ordinals[
On Friday, 30 June 2023 at 21:25:23 UTC, H. S. Teoh wrote:
On Fri, Jun 30, 2023 at 07:05:23PM +, Cecil Ward via
Digitalmars-d-learn wrote: [...]
It would help if you could post the complete code that
reproduces the problem. Or, if you do not wish to reveal your
code, reduce it to a minima
https://forum.dlang.org/thread/duetqujuoceancqtj...@forum.dlang.org
Try HashMap see if it is still a problem.
If no, then it's another example of the built in AA problem.
On Fri, Jun 30, 2023 at 07:05:23PM +, Cecil Ward via Digitalmars-d-learn
wrote:
[...]
It would help if you could post the complete code that reproduces the
problem. Or, if you do not wish to reveal your code, reduce it to a
minimal case that still exhibits the same problem, so that we can see
On 6/30/23 13:16, Cecil Ward wrote:
On Friday, 30 June 2023 at 19:58:39 UTC, FeepingCreature wrote:
Note that you can do `uint ordinal = Decls.ordinals.get(str, -1);`.
Is the second argument an ‘else’ then, my friend?
Yes, .get and friends appear in this table:
https://dlang.org/spec/ha
On Friday, 30 June 2023 at 19:58:39 UTC, FeepingCreature wrote:
On Friday, 30 June 2023 at 19:05:23 UTC, Cecil Ward wrote:
I have code roughly like the following:
dstring str = "name"d;
uint ordinal = (( str in Decls.ordinals ) !is null) ?
Decls.ordinals[ str ] : -1;
struct Decls
On Friday, 30 June 2023 at 20:12:08 UTC, Ali Çehreli wrote:
On 6/30/23 12:05, Cecil Ward wrote:
> I have code roughly like the following:
>
> dstring str = "name"d;
Aside: One almost never needs dstring.
> uint ordinal = (( str in Decls.ordinals ) !is null) ?
> Decls.ordinals[ str ]
On 6/30/23 12:05, Cecil Ward wrote:
> I have code roughly like the following:
>
> dstring str = "name"d;
Aside: One almost never needs dstring.
> uint ordinal = (( str in Decls.ordinals ) !is null) ?
> Decls.ordinals[ str ] : -1;
>
> struct Decls
> {
> uint[ dstring] ordina
On Friday, 30 June 2023 at 19:05:23 UTC, Cecil Ward wrote:
I have code roughly like the following:
dstring str = "name"d;
uint ordinal = (( str in Decls.ordinals ) !is null) ?
Decls.ordinals[ str ] : -1;
struct Decls
{
uint[ dstring] ordinals;
}
//and
Decls.ordinals[
I have code roughly like the following:
dstring str = "name"d;
uint ordinal = (( str in Decls.ordinals ) !is null) ?
Decls.ordinals[ str ] : -1;
struct Decls
{
uint[ dstring] ordinals;
}
//and
Decls.ordinals[ str ] = ordinal_counter++;
The problem is that it always r
I use it and contribute to it ;)
Have anyone had any luck with it?
So far I'm trying to install DMD as SDK but it fails with not a
valid D compiler home.
--
Dmitry Olshansky
https://olshansky.me
On Thursday, June 29, 2023 12:27:22 PM MDT Cecil Ward via Digitalmars-d-learn
wrote:
> I’m trying to debug my D program with old-fashioned printfs stuck
> in various strategic places, actually using writefln(). My
> problem is that the addition of printf fights with the existing
> declarations for
On 6/30/23 08:18, lili wrote:
How too wirte this: addPoint({4,5}, {4,6})
In this case, arrays are better but only if you don't define a
constructor, which you don't need for simple types like Point below:
struct Point {
int x;
int y;
}
void main() {
// The type is explicit on t
On Fri, Jun 30, 2023 at 03:43:14PM +, Cecil Ward via Digitalmars-d-learn
wrote:
[...]
> Since I can pass my main function some compile-time-defined input, the
> whole program should be capable of being executed with CTFE, no? So in
> that case pragma( msg ) should suffice for a test situation?
On 6/30/23 11:18 AM, lili wrote:
struct Point {
int x;
int y;
this(int x, int y) { this.x =x; this.y=y;}
}
void addPoint(Point a, Point b) {
...
}
How too wirte this: addPoint({4,5}, {4,6})
You have to write `Point(4, 5)`. The advantage is we don
On Fri, Jun 30, 2023 at 03:18:41PM +, lili via Digitalmars-d-learn wrote:
> struct Point {
> int x;
> int y;
> this(int x, int y) { this.x =x; this.y=y;}
> }
>
> void addPoint(Point a, Point b) {
>...
> }
>
> How too wirte this: addPoint({4,5}, {4,6})
On Thursday, 29 June 2023 at 23:54:45 UTC, Chris Katko wrote:
On Thursday, 29 June 2023 at 18:27:22 UTC, Cecil Ward wrote:
I’m trying to debug my D program with old-fashioned printfs
stuck in various strategic places, actually using writefln().
My problem is that the addition of printf fights w
struct Point {
int x;
int y;
this(int x, int y) { this.x =x; this.y=y;}
}
void addPoint(Point a, Point b) {
...
}
How too wirte this: addPoint({4,5}, {4,6})
On 24.06.23 18:31, Cecil Ward wrote:
I have a function that can be run at compile-time and which will be able
to output code to be injected into the D source code stream. Can I get
mixin whatever to do this for me? Mixin with a function that runs at
compile-time and creates the required source
22 matches
Mail list logo