If you don't want to run into alignment issues, you shouldn't
cast the buffer directly: http://dpaste.dzfl.pl/b522f911871a
Does D have a recommended package for this - like (n)curses for C?
On Friday, 20 March 2015 at 10:02:27 UTC, Dennis Ritchie wrote:
For example,
lazy int sum(int a = 3, int b = 5) {
return a + b;
}
That is, if the function is not invoked, it should not be
calculated at compile time.
I don't understand what you mean. You mean a function that isn't
On 2015-03-19 13:22:44 +, Benjamin Thaut said:
Generally don't expect to many things to work with DLLs at the moment.
Hi, well, I think what's available is good enough to get most things done.
Generally speaking only exporting global functions works. Don't try to
export classes /
On Friday, 20 March 2015 at 10:29:45 UTC, DLearner wrote:
Does D have a recommended package for this - like (n)curses for
C?
You could just use nurses:
https://github.com/D-Programming-Deimos/ncurses
On Friday, 20 March 2015 at 10:29:45 UTC, DLearner wrote:
Does D have a recommended package for this - like (n)curses for
C?
http://stackoverflow.com/questions/29061809/tui-text-user-interface-for-d
For example,
lazy int sum(int a = 3, int b = 5) {
return a + b;
}
That is, if the function is not invoked, it should not be
calculated at compile time.
On Fri, 20 Mar 2015 22:11:51 +
weaselcat via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Friday, 20 March 2015 at 14:25:22 UTC, ref2401 wrote:
Why aren't methods of class final by default?
history
use final class, it should devirtualize all methods.
see:
On Fri, 20 Mar 2015 16:27:04 -0700
Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Friday, March 20, 2015 23:53:14 Daniel Kozak via Digitalmars-d-learn wrote:
On Fri, 20 Mar 2015 22:11:51 +
weaselcat via Digitalmars-d-learn
On Friday, 20 March 2015 at 23:47:37 UTC, Daniel Kozak wrote:
On Fri, 20 Mar 2015 16:27:04 -0700
Jonathan M Davis via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
On Friday, March 20, 2015 23:53:14 Daniel Kozak via
Digitalmars-d-learn wrote:
On Fri, 20 Mar 2015 22:11:51
On Friday, March 20, 2015 23:53:14 Daniel Kozak via Digitalmars-d-learn wrote:
On Fri, 20 Mar 2015 22:11:51 +
weaselcat via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Friday, 20 March 2015 at 14:25:22 UTC, ref2401 wrote:
Why aren't methods of class final by
On Friday, 20 March 2015 at 12:15:22 UTC, Dennis Ritchie wrote:
On Friday, 20 March 2015 at 10:38:17 UTC, John Colvin wrote:
I don't understand what you mean. You mean a function that
isn't compiled if it isn't used anywhere?
Yes. That's exactly what I mean.
Use case?
On Friday, 20 March 2015 at 14:25:22 UTC, ref2401 wrote:
Why aren't methods of class final by default?
Because of a design choice to maximise usage flexibility that is
questionable but not likely to change.
On Friday, 20 March 2015 at 14:20:16 UTC, John Colvin wrote:
On Friday, 20 March 2015 at 13:35:10 UTC, Dennis Ritchie wrote:
Use case?
No. I need to be able to make an array factorials is not
evaluated, if I don't.
import std.stdio;
enum N = 15;
static int[] factorials =
Why aren't methods of class final by default?
On Friday, 20 March 2015 at 10:38:17 UTC, John Colvin wrote:
I don't understand what you mean. You mean a function that
isn't compiled if it isn't used anywhere?
Yes. That's exactly what I mean.
On Friday, 20 March 2015 at 10:29:45 UTC, DLearner wrote:
Does D have a recommended package for this - like (n)curses for
C?
I cannot recommend it because i've just found the package, it
like Pascal turbo vision but in D.
https://github.com/bbodi/dvision
A few years ago someine else
Use case?
No. I need to be able to make an array factorials is not
evaluated, if I don't.
import std.stdio;
enum N = 15;
static int[] factorials = memoizeFactorials(N); // lazy array? :)
int[] memoizeFactorials(int n)
{
if (!__ctfe) {
// Make sure that this function is never
On Friday, 20 March 2015 at 12:52:16 UTC, Tobias Pankrath wrote:
Use case?
I do this with local imports so a module works without
dependencies unless you use the specific functions that need the
additional module.
Now I am totally confused. lazy and eager evaluation are
unrelated to compile time and run time.
On Fri, Mar 20, 2015 at 10:29:44AM +, DLearner via Digitalmars-d-learn
wrote:
Does D have a recommended package for this - like (n)curses for C?
Try Adam Ruppe's excellent terminal.d -- I use it for my own TUI
programs, and it's pretty good.
On 03/20/2015 09:24 PM, Dennis Ritchie wrote: Hi,
How do I replace double.init?
import std.stdio : writeln;
import std.algorithm : uninitializedFill;
void main() {
double[] arr = new double[6];
uninitializedFill(arr[0 .. $ - 2], 3.25);
writeln(arr);
assert(arr ==
On Saturday, 21 March 2015 at 04:53:20 UTC, Ali Çehreli wrote:
nan cannot be used in comparisons. It is neither greater than
nor less than any value. You cannot even compare it against
itself. nan==nan would always be false.
The solution is to call std.math.isNaN. In this case, you have
to
Hi,
How do I replace double.init?
import std.stdio : writeln;
import std.algorithm : uninitializedFill;
void main() {
double[] arr = new double[6];
uninitializedFill(arr[0 .. $ - 2], 3.25);
writeln(arr);
assert(arr == [3.25, 3.25, 3.25, 3.25, double.init,
On Friday, 20 March 2015 at 13:35:10 UTC, Dennis Ritchie wrote:
Use case?
No. I need to be able to make an array factorials is not
evaluated, if I don't.
import std.stdio;
enum N = 15;
static int[] factorials = memoizeFactorials(N); // lazy array?
:)
int[] memoizeFactorials(int n)
{
On Friday, 20 March 2015 at 18:05:07 UTC, Ivan Kazmenko wrote:
Thanks. I was able to reproduce the workflow you showed in the
gif to the part where an error pop-up (e.g. no property iota
for type int) is followed by suggesting the appropriate fix.
Do I need another tool for that? Colorout
On Friday, 20 March 2015 at 18:36:19 UTC, Vladimir Panteleev
wrote:
On Friday, 20 March 2015 at 18:05:07 UTC, Ivan Kazmenko wrote:
Thanks. I was able to reproduce the workflow you showed in
the gif to the part where an error pop-up (e.g. no property
iota for type int) is followed by
On Fri, 20 Mar 2015 10:29:44 +, DLearner wrote:
Does D have a recommended package for this - like (n)curses for C?
most of the time you don't really need a full-blown UI, but something to
control the terminal and draw frames. ;-) Adam's module does that.
signature.asc
Description: PGP
Hello,
after some coding i needed to update some external libraries like
DerelictSDL2. As we all know, one update isn't enough, so i
updated my whole d-environment at the end of the day (current dmd
version, VisualD).
After getting rid of some linking errors (symbols undefined) i
have only one
On Thursday, 19 March 2015 at 16:06:31 UTC, Vladimir Panteleev
wrote:
On Thursday, 19 March 2015 at 14:32:53 UTC, Ivan Kazmenko wrote:
Hey, I also happen to use Far Manager and its internal editor,
at least for simple projects. Is that dcheck triggering a Far
plugin? I have a bit of
On Friday, 20 March 2015 at 14:27:06 UTC, John Colvin wrote:
I made a mistake about the static variable and thread-local
storage.
immutable(int)[] factorials()() @property
{
static immutable int[N] results = memoizeFactorials(N);
return results[];
}
is the correct way to do it if you
You can refer to
http://forum.dlang.org/post/jhbgaacoguxaubxgp...@forum.dlang.org
Do you use dub?
I resolved my problems (on Win) abandoning dub
and using makefile.
On Friday, 20 March 2015 at 17:35:19 UTC, Koi wrote:
Hello,
after some coding i needed to update some external libraries
like
Still does not compile, thanks for the idea though. I think it's
better to avoid Temple, compilation of Diet templates seems to be
better anyway. E.g. temple seems to accept % var.nonexistingname
% while diet gives a compile error for #{nonexistingname}.
Meanwhile I figured out an easy way to
On Friday, 20 March 2015 at 14:25:22 UTC, ref2401 wrote:
Why aren't methods of class final by default?
See: http://forum.dlang.org/thread/lfqoan$5qq$1...@digitalmars.com
On Friday, 20 March 2015 at 14:25:22 UTC, ref2401 wrote:
Why aren't methods of class final by default?
history
use final class, it should devirtualize all methods.
see: https://github.com/D-Programming-Language/dmd/pull/4427
35 matches
Mail list logo