On Wednesday, 22 October 2014 at 01:21:19 UTC, Freddy wrote:
Is there any advice/tips for reading medium/big D codebases?
Somewhat D specific: I would consider an IDE/editor like Eclipse
with DDT that can give an outline of the data structures &
functions names in a source file to make the fi
On Wednesday, 22 October 2014 at 01:21:19 UTC, Freddy wrote:
Is there any advice/tips for reading medium/big D codebases?
I'm not aware of there being anything about D which makes it any
different to dig into a large codebase than it is for any other
language. The usual suggestion that I've h
On Wednesday, 22 October 2014 at 01:58:19 UTC, neal wrote:
On Wednesday, 22 October 2014 at 01:02:17 UTC, bearophile wrote:
neal:
Anybody have any suggestions?
Something like this, perhaps?
data.sort!q{ a[4] > b[4] };
Bye,
bearophile
Hmmm.. Im getting some interesting results here. So wh
On Wednesday, October 22, 2014 00:45:17 Lucas Burson via
Digitalmars-d-learn
wrote:
I'm trying to create a primitive type given a specific buffer
slice. I can place the uint into a sliced buffer but I'm getting
compiler errors when using a slice to create the uint. Still new
to Dlang and unfamil
On Wednesday, 22 October 2014 at 01:02:17 UTC, bearophile wrote:
neal:
Anybody have any suggestions?
Something like this, perhaps?
data.sort!q{ a[4] > b[4] };
Bye,
bearophile
Hmmm.. Im getting some interesting results here. So when i put
all of the populations in an area and used this cod
On Wed, 22 Oct 2014 01:30:48 +
Lucas Burson via Digitalmars-d-learn
wrote:
> ketmar, we meet again! Your explanation is great and that solved
> my problem. Thank you. Maybe I'll try out templates next...
yep, i remember. i was glad to help you. ;-)
signature.asc
Description: PGP signature
On Wednesday, 22 October 2014 at 01:08:52 UTC, ketmar via
Digitalmars-d-learn wrote:
the short answer:
uint fromBuf =
bigEndianToNative!uint(cast(ubyte[4])buffer[offset..offset+4]);
ketmar, we meet again! Your explanation is great and that solved
my problem. Thank you. Maybe I'll try out t
Is there any advice/tips for reading medium/big D codebases?
On Wed, 22 Oct 2014 00:45:17 +
Lucas Burson via Digitalmars-d-learn
wrote:
> I'm trying to create a primitive type given a specific buffer
> slice. I can place the uint into a sliced buffer but I'm getting
> compiler errors when using a slice to create the uint. Still new
> to Dlang and un
neal:
Anybody have any suggestions?
Something like this, perhaps?
data.sort!q{ a[4] > b[4] };
Bye,
bearophile
I'm trying to create a primitive type given a specific buffer
slice. I can place the uint into a sliced buffer but I'm getting
compiler errors when using a slice to create the uint. Still new
to Dlang and unfamiliar with the template system.
How do I get this working?
import std.bitmanip;
int
On Wednesday, 22 October 2014 at 00:32:56 UTC, neal wrote:
Just curious if this is possible. I have some data on different
countries that i have stored in a multidimensional array called
data[][]. What I want to do is sort data[][] by population
which happens to be stored in data[i][4] where i
On Wednesday, 22 October 2014 at 00:36:22 UTC, Joel wrote:
On Wednesday, 22 October 2014 at 00:32:56 UTC, neal wrote:
Just curious if this is possible. I have some data on
different countries that i have stored in a multidimensional
array called data[][]. What I want to do is sort data[][] by
Just curious if this is possible. I have some data on different
countries that i have stored in a multidimensional array called
data[][]. What I want to do is sort data[][] by population which
happens to be stored in data[i][4] where i is the index to
iterate from country to country.
I would
On Wed, 22 Oct 2014 00:57:59 +0300
ketmar via Digitalmars-d-learn
wrote:
> consitions
i don't even know what this word means. honestly.
signature.asc
Description: PGP signature
Funnily enough I was just playing with this last night trying to
get Excel to talk to dlang DLL. I borrowed a C example elsewhere
on web and used a different .def file. Something like this:
LIBRARY dprop
DESCRIPTION 'My DLL written in D'
EXETYPE NT
CODE
On Tue, 21 Oct 2014 21:48:14 +
Kapps via Digitalmars-d-learn wrote:
> I like D's templates, it's one of the things that makes me like D
> more than C#. But they can definitely get quite complex. C#
> limits templates to generic types, like List, and for a
> beginner I think that's an easie
On Tuesday, 21 October 2014 at 13:57:23 UTC, Kagamin wrote:
On Monday, 20 October 2014 at 15:07:43 UTC, MrSmith wrote:
On Monday, 20 October 2014 at 14:05:29 UTC, Kagamin wrote:
Do it the COM way: publish IModule2 interface and declare
GetInterface method, which will return a prepared pointer,
On Tuesday, 21 October 2014 at 09:14:08 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 21 Oct 2014 09:01:32 +
Kapps via Digitalmars-d-learn
wrote:
no template magic
that's very bad. it's time to stop making people think that
templates
are inevitably arcane.
I like D's templates,
Hi,
by copy and paste the example from
http://wiki.dlang.org/Win32_DLLs_in_D
exactly as described, the following errors is thrown:
J:\Projects\Tests\Example>dmd test mydll.lib -g
OPTLINK (R) for Win32 Release 8.00.15
test.obj(test)
Error 42: Symbol Undefined _D5mydll12__ModuleInfoZ
I created
On Tuesday, 21 October 2014 at 17:00:49 UTC, Meta wrote:
There is no such thing as global scope in D.
While that's technically true (and very good for avoiding symbol
conflicts), modules at the module level are still typically
referred to as global variables.
On Tuesday, 21 October 2014 at 15:51:27 UTC, MachineCode wrote:
pure functions are also supposed to don't use global variables
at all, according to functional programming paradigm
The functional programming paradigm is kind of irrelevant to D's
pure, which should really be something more like
On Tuesday, 21 October 2014 at 16:56:06 UTC, Solomon E wrote:
On Tuesday, 21 October 2014 at 15:51:27 UTC, MachineCode wrote:
...
...
pure functions are also supposed to don't use global variables
at all, according to functional programming paradigm
Pure functions are immutables (constants b
On Tuesday, 21 October 2014 at 15:51:27 UTC, MachineCode wrote:
...
...
pure functions are also supposed to don't use global variables
at all, according to functional programming paradigm
Pure functions are immutables (constants but not "const" in the D
or C++ senses) and can use other immut
On Tue, 21 Oct 2014 16:47:04 +
Solomon E via Digitalmars-d-learn
wrote:
> That's unsafe because the implementation might change, and
> pointer arithmetic is unsafe in general.
sure, ponter casting is implementation-dependend. but .ptr is
guaranteed to work as expected. 'a' is just a `struct
On Tuesday, October 21, 2014 08:02:50 bearophile via
Digitalmars-d-learn
wrote:
Currently this code gets rejected:
const int[] a = [1];
void main() pure {
auto y = a[0];
}
test2.d(3,14): Error: pure function 'D main' cannot access
mutable static data 'a'
test2.d(3,14): Error: pure functi
On Tuesday, 21 October 2014 at 14:25:20 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 21 Oct 2014 13:43:29 +
Solomon E via Digitalmars-d-learn
wrote:
`b[0] = 8;` or `b[] = 8;` changes a. Printing the values for
&a and &b shows they're different pointers, but (a is b)
returns true.
On Tuesday, 21 October 2014 at 08:02:52 UTC, bearophile wrote:
Currently this code gets rejected:
const int[] a = [1];
void main() pure {
auto y = a[0];
}
test2.d(3,14): Error: pure function 'D main' cannot access
mutable static data 'a'
test2.d(3,14): Error: pure function 'D main' cannot
On Tue, 21 Oct 2014 17:25:09 +0300
ketmar via Digitalmars-d-learn
wrote:
> On Tue, 21 Oct 2014 13:43:29 +
> Solomon E via Digitalmars-d-learn
> wrote:
>
> > `b[0] = 8;` or `b[] = 8;` changes a. Printing the values for &a
> > and &b shows they're different pointers, but (a is b) returns
>
On Tue, 21 Oct 2014 13:43:29 +
Solomon E via Digitalmars-d-learn
wrote:
> `b[0] = 8;` or `b[] = 8;` changes a. Printing the values for &a
> and &b shows they're different pointers, but (a is b) returns
> true. So I still have more to learn about how it does that.
that's 'cause '&b' taking a
On Monday, 20 October 2014 at 15:07:43 UTC, MrSmith wrote:
On Monday, 20 October 2014 at 14:05:29 UTC, Kagamin wrote:
Do it the COM way: publish IModule2 interface and declare
GetInterface method, which will return a prepared pointer,
which you would reinterpret cast to IModule2.
Will it work
On Tuesday, 21 October 2014 at 12:30:30 UTC, anonymous wrote:
On Tuesday, 21 October 2014 at 12:08:35 UTC, Solomon E wrote:
On Tuesday, 21 October 2014 at 08:48:09 UTC, safety0ff wrote:
const int[] a;
int[] b;
static this()
{
b = [1];
a = b;
}
`a` isn't a reference to `b`. `a` is assigne
This doesn't compiles
http://dpaste.dzfl.pl/bbcc31fbe016
On Tuesday, 21 October 2014 at 12:08:35 UTC, Solomon E wrote:
On Tuesday, 21 October 2014 at 08:48:09 UTC, safety0ff wrote:
const int[] a;
int[] b;
static this()
{
b = [1];
a = b;
}
`a` isn't a reference to `b`. `a` is assigned by value and has
its own storage.
`a` is indeed a copy o
On Tue, 21 Oct 2014 11:51:16 +
via Digitalmars-d-learn wrote:
> The problem with template-programming in XSLT/C++/D is that if
> you want to learn functional programming you are better off using
> a good functional language.
templates arent about FP only. yet i agree that Scheme is a very g
On Tuesday, 21 October 2014 at 08:48:09 UTC, safety0ff wrote:
On Tuesday, 21 October 2014 at 08:25:07 UTC, bearophile wrote:
Minas Mina:
Aren't pure functions supposed to return the same result
every time? If yes, it is correct to not accept it.
But how can main() not be pure? Or, how can't
On Tuesday, 21 October 2014 at 11:43:56 UTC, ketmar via
Digitalmars-d-learn wrote:
and other people keep pointing at languages without templates
and metaprogramming as "good for learing". it's closed circle.
The problem with template-programming in XSLT/C++/D is that if
you want to learn funct
On Tue, 21 Oct 2014 11:20:42 +
Paulo Pinto via Digitalmars-d-learn
wrote:
> People think templates are magic, due to their skillset.
and other people keep pointing at languages without templates and
metaprogramming as "good for learing". it's closed circle.
signature.asc
Description: PGP si
On Tuesday, 21 October 2014 at 09:14:08 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 21 Oct 2014 09:01:32 +
Kapps via Digitalmars-d-learn
wrote:
no template magic
that's very bad. it's time to stop making people think that
templates
are inevitably arcane.
People think template
Szymon Gatner:
const int[] a;
int[] b;
static this()
{
b = [1];
a = b;
}
Ant this code works? What is the point of const then if you can
assign it to mutable slice?
It works, and I think it should work. Inside the (module)
constructor the const state is handled differently.
Thank
On Monday, 20 October 2014 at 17:37:22 UTC, Sean Kelly wrote:
With all the recent work on the GC, we really really need to
start tracking which thread owns a given non-shared object so it
can be finalized properly. This may mean having the process of
casting away shared make the executing thread
On Tuesday, 21 October 2014 at 08:48:09 UTC, safety0ff wrote:
On Tuesday, 21 October 2014 at 08:25:07 UTC, bearophile wrote:
Minas Mina:
Aren't pure functions supposed to return the same result
every time? If yes, it is correct to not accept it.
But how can main() not be pure? Or, how can't
On Tue, 21 Oct 2014 09:01:32 +
Kapps via Digitalmars-d-learn wrote:
> no template magic
that's very bad. it's time to stop making people think that templates
are inevitably arcane.
signature.asc
Description: PGP signature
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote:
I'm a newbie to programming and have been looking into the D
lang as a general purposing language to learn, yet the D
overview indicates that java would be a better language to
learn for your first programming language. Why? Looks l
On Tuesday, 21 October 2014 at 08:25:07 UTC, bearophile wrote:
Minas Mina:
Aren't pure functions supposed to return the same result every
time? If yes, it is correct to not accept it.
But how can main() not be pure? Or, how can't the 'a' array be
immutable?
Bye,
bearophile
There can exis
Minas Mina:
Aren't pure functions supposed to return the same result every
time? If yes, it is correct to not accept it.
But how can main() not be pure? Or, how can't the 'a' array be
immutable?
Bye,
bearophile
On Tuesday, 21 October 2014 at 08:02:52 UTC, bearophile wrote:
Currently this code gets rejected:
const int[] a = [1];
void main() pure {
auto y = a[0];
}
test2.d(3,14): Error: pure function 'D main' cannot access
mutable static data 'a'
test2.d(3,14): Error: pure function 'D main' cannot
Currently this code gets rejected:
const int[] a = [1];
void main() pure {
auto y = a[0];
}
test2.d(3,14): Error: pure function 'D main' cannot access
mutable static data 'a'
test2.d(3,14): Error: pure function 'D main' cannot access
mutable static data 'a'
But is this a good idea? Isn'
Nordlöw:
It would be nice to have a lambda-variant of std.string.tr to
call like
x.tr!isWhite(['_'])
If your text is ASCII, then there is std.ascii.whitespace that
can be given as argument to std.string.tr.
Bye,
bearophile
On Tuesday, 21 October 2014 at 07:31:59 UTC, Nordlöw wrote:
std.string.tr is my preferred choice here :)
It would be nice to have a lambda-variant of std.string.tr to
call like
x.tr!isWhite(['_'])
On Monday, 20 October 2014 at 23:25:18 UTC, bearophile wrote:
But with tr you can also replace the spaces with the underscore.
std.string.tr is my preferred choice here :)
Thanks!
51 matches
Mail list logo