On Saturday, 25 April 2015 at 05:14:57 UTC, Rikki Cattermole
wrote:
On 25/04/2015 5:07 p.m., Jens Bauer wrote:
I hope to find a good way to use import for microcontroller
libraries,
so it'll be easy for everyone. I'm thinking about something
like ...
import mcu.stm32f439.all
Ugh, package.
Jacob Carlborg writes:
> On 2015-04-24 20:37, Steven Schveighoffer wrote:
>
>> So am I going crazy? Or is dmd doing things differently depending on
>> where its environment is? Any compiler gurus out there understand why
>> the symbol is different?
>>
>> I don't want to file a bug with this, beca
On 25/04/2015 7:04 p.m., Jens Bauer wrote:
On Saturday, 25 April 2015 at 05:14:57 UTC, Rikki Cattermole wrote:
On 25/04/2015 5:07 p.m., Jens Bauer wrote:
I hope to find a good way to use import for microcontroller libraries,
so it'll be easy for everyone. I'm thinking about something like ...
On Saturday, 25 April 2015 at 07:08:26 UTC, Rikki Cattermole
wrote:
I was referring to package.d files. And publically importing
all below modules/packages.
Normally, one would want to import only the most necessary parts.
Let's take an example: A microcontroller has USB, LCD controller,
Eth
On 25/04/2015 7:31 p.m., Jens Bauer wrote:
On Saturday, 25 April 2015 at 07:08:26 UTC, Rikki Cattermole wrote:
I was referring to package.d files. And publically importing all below
modules/packages.
Normally, one would want to import only the most necessary parts.
Let's take an example: A mi
On Saturday, 25 April 2015 at 08:30:10 UTC, Rikki Cattermole
wrote:
On 25/04/2015 7:31 p.m., Jens Bauer wrote:
Normally, one would want to import only the most necessary
parts. Let's take an example: A microcontroller has USB, LCD
controller, Ethernet, U(s)ART, SPI, CAN, I2S, I2C and also
su
On Friday, 24 April 2015 at 18:28:16 UTC, Guillaume wrote:
Hello, I'm trying to make a regex comparison with D, based off
of this article: https://swtch.com/~rsc/regexp/regexp1.html
I've written my code like so:
import std.stdio, std.regex;
void main(string argv[]) {
string m = argv[
Hello, D community!
I'm pretty new to D and to compiled languages in general, and
have primarily web background (PHP, JS), when JSON workflow is
very organic. I was always sure that JSON is a simple thing, but
std.json proves me wrong. So may I have a little advice from more
experienced D fol
struct MyStruct {}
void main(string[] args) {
string str = "blah-blah";
auto d1 = (MyStruct) { writeln("delegate-str: ", str); };
writeln(typeid(typeof(d1)));
}
dmd: 2067
os: Win8.1
build script: dmd main.d -ofconsole-app.exe -debug -unittest -wi
- if delegate has no
On Saturday, 25 April 2015 at 07:04:58 UTC, Jens Bauer wrote:
Things that can be recycled would be carefully written drivers,
such as LCD drivers that uses the SPI protocol. The SPI
interface itself cannot be recycled, though, as each device has
different SPI hardware and different GPIO hardwar
On Saturday, 25 April 2015 at 05:07:04 UTC, Jens Bauer wrote:
I hope to find a good way to use import for microcontroller
libraries, so it'll be easy for everyone. I'm thinking about
something like ...
import mcu.stm32f439.all
I think that belongs in the makefile/dub.json as
-version=STM32F
On Saturday, 25 April 2015 at 07:31:45 UTC, Jens Bauer wrote:
I wonder if you can get e.g. interfaces and classes working.
I hope I will. ;)
I think classes are really a must. The only thing that I
(currently) see that could perhaps block this from working,
would be missing support for static
On Saturday, 25 April 2015 at 05:07:04 UTC, Jens Bauer wrote:
While I remember it ... I had to nullify a number of imports in
stdint. They simply do not belong in there. :)
Eg. I do not want FILE* if I aks for stdint. But FILE* is
forced upon me, because wchar_t includes it. What does a
wchar_t
Hi,
Is there a way to apply a function "format" with BigInt?
-
import std.stdio, std.bigint, std.string;
void main() {
BigInt n = -10;
string s = format("%b", n); // error
writeln(s);
}
On Saturday, 25 April 2015 at 10:23:25 UTC, ref2401 wrote:
struct MyStruct {}
void main(string[] args) {
string str = "blah-blah";
auto d1 = (MyStruct) { writeln("delegate-str: ", str); };
writeln(typeid(typeof(d1)));
}
dmd: 2067
os: Win8.1
build script: dmd main.d -
I want a function with parameter o!(const(Form)) to accept both
o!(Form) and o!(immutable(Form))
Is there a way to do it?
import std.stdio;
import std.traits;
class Form
{
int number = 10;
}
struct o(T)
{
T data;
this(T data)
{
this.data =
On Saturday, 25 April 2015 at 14:52:45 UTC, sclytrack wrote:
I want a function with parameter o!(const(Form)) to accept both
o!(Form) and o!(immutable(Form))
Is there a way to do it?
import std.stdio;
import std.traits;
class Form
{
int number = 10;
}
struct o(T)
{
T dat
It works when you exclude the recursive alias this:
static if(!is(T == const)) alias constify this;
Your original program crashes the compiler, which is always a
bug. I filed an issue:
https://issues.dlang.org/show_bug.cgi?id=14499
Thank you, very much.
Before you start to write device drivers I remind you that it is
not possible to just write and read the peripheral registers via
pointers. The compiler will do optimizations like omit reads and
writes or reorder them.
My very simple uart driver is here:
https://bitbucket.org/timosi/minlibd/s
"tired_eyes" writes:
>
> First issue: what is the proper ("idiomatic") way to conver JSONValue
> to the proper types?
>
> Second: what is the proper way of handling boolean values in JSON (how
> to convert JSON_TYPE.TRUE and JSON_TYPE.FALSE to bool)?
>
> Righ now I'm doing is something like this:
On Saturday, 25 April 2015 at 11:56:55 UTC, Martin Nowak wrote:
You better dismiss the idea of using druntime/phobos. They are
not optimized for code size and contain a lot of stuff that'll
never work.
You can replace the core.stdc headers with bindings for
nanolib, but again it's not necessar
On Saturday, 25 April 2015 at 11:34:58 UTC, Martin Nowak wrote:
You can very well abstract an SPI, just need to have an
abstraction for pins.
http://developer.mbed.org/handbook/SPI
Considering all the problems involved, I will not be doing any
abstraction.
What I will provide, is a set of te
On Saturday, 25 April 2015 at 16:28:24 UTC, Timo Sintonen wrote:
My work is based on the feature that a shared variable is
marked as volatile in gcc. This feature is buggy and should not
be used in the future.
I think volatileLoad and volatileStore are intended for this
(please correct me if
On Saturday, 25 April 2015 at 16:32:50 UTC, Timo Sintonen wrote:
On Saturday, 25 April 2015 at 11:56:55 UTC, Martin Nowak wrote:
You better dismiss the idea of using druntime/phobos.
The minimum runtime I have made does fit in 64k rom/ 64k ram,
which all STM32F4 devices have. With some work
Am Sat, 25 Apr 2015 11:38:45 +
schrieb "Martin Nowak" :
> On Saturday, 25 April 2015 at 05:07:04 UTC, Jens Bauer wrote:
> > I hope to find a good way to use import for microcontroller
> > libraries, so it'll be easy for everyone. I'm thinking about
> > something like ...
> >
> > import mcu.s
On Saturday, 25 April 2015 at 11:38:46 UTC, Martin Nowak wrote:
On Saturday, 25 April 2015 at 05:07:04 UTC, Jens Bauer wrote:
I hope to find a good way to use import for microcontroller
libraries, so it'll be easy for everyone. I'm thinking about
something like ...
import mcu.stm32f439.all
On Saturday, 25 April 2015 at 11:50:19 UTC, Martin Nowak wrote:
On Saturday, 25 April 2015 at 07:31:45 UTC, Jens Bauer wrote:
Static constructors are possible if you strip down ModuleInfo
(requires compiler hacking).
You should care about that stuff last. It's way more important
to make things
On Saturday, 25 April 2015 at 17:11:22 UTC, Johannes Pfau wrote:
Am Sat, 25 Apr 2015 11:38:45 +
schrieb "Martin Nowak" :
On Saturday, 25 April 2015 at 05:07:04 UTC, Jens Bauer wrote:
>
> import mcu.stm32f439.all
I think that belongs in the makefile/dub.json as
-version=STM32F439.
Then yo
As I'm impressed with the interest in the startup-files I've made
so far, I'd like to add support for more devices.
In order to do so, I'd like to ask on this forum, which devices
you would be interested in.
Please list specific device names/numbers if possible, but device
families are of cour
On Saturday, 25 April 2015 at 17:04:18 UTC, Jens Bauer wrote:
I think volatileLoad and volatileStore are intended for this
(please correct me if my understanding is wrong).
Yes. Actually I am not sure whether they already exist in gdc or
not.
Try to write for example
regs.cmdr |= 0x20
with
On Saturday, 25 April 2015 at 09:56:25 UTC, tired_eyes wrote:
A brief look at code.dlang.org gives us 7 (!) additional JSON
libraries. Keeping in mind that D community isn't so huge, I
think I'm not the only person struggling with std.json. Are
there any plans on upgrading it?
See http://wiki
On Saturday, 25 April 2015 at 09:56:25 UTC, tired_eyes wrote:
I think this is ugly and clunky approach, what is the beautiful
one?
What you clearly need is a serializer:
look at these:
http://wiki.dlang.org/Libraries_and_Frameworks#Serialization
and also:
https://github.com/search?utf8=✓&q=
On Saturday, 25 April 2015 at 17:58:59 UTC, Timo Sintonen wrote:
On Saturday, 25 April 2015 at 17:04:18 UTC, Jens Bauer wrote:
I think volatileLoad and volatileStore are intended for this
(please correct me if my understanding is wrong).
Yes. Actually I am not sure whether they already exist
On Saturday, 25 April 2015 at 13:13:10 UTC, Dennis Ritchie wrote:
Hi,
Is there a way to apply a function "format" with BigInt?
-
import std.stdio, std.bigint, std.string;
void main() {
BigInt n = -10;
string s = format("%b", n); // error
writeln(s);
}
BigInt onl
Am Sat, 25 Apr 2015 18:31:45 +
schrieb "Jens Bauer" :
> On Saturday, 25 April 2015 at 17:58:59 UTC, Timo Sintonen wrote:
> > On Saturday, 25 April 2015 at 17:04:18 UTC, Jens Bauer wrote:
> >
> >> I think volatileLoad and volatileStore are intended for this
> >> (please correct me if my unders
On Saturday, 25 April 2015 at 19:33:05 UTC, Johannes Pfau wrote:
Am Sat, 25 Apr 2015 18:31:45 +
schrieb "Jens Bauer" :
I don't want to start another volatile discussion, but to me
it seems an attribute would not be a bad idea.
-And for completeness... read-only, write-only, read/write and
On Saturday, 25 April 2015 at 18:58:50 UTC, Marc Schütz wrote:
BigInt only supports %d, %x, %X and %s:
http://dlang.org/phobos/std_bigint.html#.BigInt.toString
The missing %o and %b were probably an oversight, feel free to
file an enhancement request or submit a PR.
All right. I will file a r
On 04/25/2015 01:23 PM, Dennis Ritchie wrote:
which section should apply similar requests?
https://issues.dlang.org/
After clicking "File and Issue":
Component: Phobos
Severity: Enhancement
Ali
Hello everyone , first congratulations for the wonderful forum ,
I wish someone could help me , I am writing a small basic
interpreter in D and I am with some difficulties.
estoutentando manupular the setjmp / longjmp buffers , but the
error , I use windows 7 and the dmd 2067 , will be whose
I ran into this infuriatingly confusing situation just now:
static assert(is(typeof(Parent.init.new Child) == Parent.Child));
// fine
alias P = Parent;
alias T = Parent.Child;
static assert(is(typeof(P.init.new T) == T)); // nope!
Wat???
After much confusion, I finally discovered this in my
On Saturday, 25 April 2015 at 23:51:05 UTC, rcorre wrote:
I ran into this infuriatingly confusing situation just now:
static assert(is(typeof(Parent.init.new Child) ==
Parent.Child)); // fine
alias P = Parent;
alias T = Parent.Child;
static assert(is(typeof(P.init.new T) == T)); // nope!
Wa
On Saturday, 25 April 2015 at 19:33:05 UTC, Johannes Pfau wrote:
volatileLoad is not in gdc yet. I've written the code some
months ago
but I need to update it and then it needs to be reviewed.
It's officially in 2.067.0 for anyone who's wondering.
Volatile!T: http://dpaste.dzfl.pl/dd7fa4c
Consider the following code:
struct ArrayWrapper(T)
{
T t;
this(T t)
{
assert(t !is null);
}
@disable this(typeof(null));
typeof(this) opAssign(T val)
{
assert(t !is null);
this.t = val;
return this;
}
On Saturday, 25 April 2015 at 16:32:50 UTC, Timo Sintonen wrote:
On Saturday, 25 April 2015 at 11:56:55 UTC, Martin Nowak wrote:
I have not yet needed anything from libc/phobos in my programs.
I think there's a few gems that can be cherry-picked out of
Phobos, especially for metaprogramming:
On 26/04/2015 5:53 a.m., Jens Bauer wrote:
As I'm impressed with the interest in the startup-files I've made so
far, I'd like to add support for more devices.
In order to do so, I'd like to ask on this forum, which devices you
would be interested in.
Please list specific device names/numbers if
The following code spits out pages of error messages, and it's
driving me insane. I know that Object.toString only has a mutable
variant, so how am I supposed to use writeln, toString, etc. with
an inout, const, or immutable object?
void main(inout string[] args)
{
import std.stdio;
On Sunday, 26 April 2015 at 03:09:17 UTC, Meta wrote:
The following code spits out pages of error messages, and it's
driving me insane. I know that Object.toString only has a
mutable variant, so how am I supposed to use writeln, toString,
etc. with an inout, const, or immutable object?
void m
On Sunday, 26 April 2015 at 03:48:00 UTC, tcak wrote:
On Sunday, 26 April 2015 at 03:09:17 UTC, Meta wrote:
The following code spits out pages of error messages, and it's
driving me insane. I know that Object.toString only has a
mutable variant, so how am I supposed to use writeln,
toString, e
On Sunday, April 26, 2015 03:51:25 Meta via Digitalmars-d-learn wrote:
> On Sunday, 26 April 2015 at 03:48:00 UTC, tcak wrote:
> > On Sunday, 26 April 2015 at 03:09:17 UTC, Meta wrote:
> >> The following code spits out pages of error messages, and it's
> >> driving me insane. I know that Object.toS
On Sunday, 26 April 2015 at 00:52:56 UTC, Mike wrote:
On Saturday, 25 April 2015 at 16:32:50 UTC, Timo Sintonen wrote:
I think there's a few gems that can be cherry-picked out of
Phobos, especially for metaprogramming:
std.traits
std.typecons
std.typetuple
There are also a couple things in
On Sunday, 26 April 2015 at 04:52:36 UTC, Jonathan M Davis wrote:
It's only undefined if mutation is involved, though I don't
know if mutation is involved in this case or not
I was thinking that a class can define an arbitrary toString()
that modifies it some of its member variables, which def
On 4/25/2015 10:02 PM, Timo Sintonen via Digitalmars-d-learn wrote:
-Import mess. Phobos files import several other files. Some of them
cannot be used. Work is going on to remove unnecessary imports and use
scoped imports. It is important that imports for unittests are only in
unittest blocks.
-
On Sunday, April 26, 2015 05:09:30 Meta via Digitalmars-d-learn wrote:
> On Sunday, 26 April 2015 at 04:52:36 UTC, Jonathan M Davis wrote:
> > It's only undefined if mutation is involved, though I don't
> > know if mutation is involved in this case or not
>
> I was thinking that a class can define
On Sat, 25 Apr 2015 23:25:13 +, Cassio Butrico wrote:
> Hello everyone , first congratulations for the wonderful forum , I wish
> someone could help me , I am writing a small basic interpreter in D and
> I am with some difficulties.
>
> estoutentando manupular the setjmp / longjmp buffers , b
54 matches
Mail list logo