Re: My Android project nearing beta

2020-01-06 Thread visitor via Digitalmars-d-announce

On Monday, 6 January 2020 at 14:37:54 UTC, Adam D. Ruppe wrote:

gah, there goes that idea. So I guess that means the lambda 
callbacks for ui classes must be implemented in Java too. alas.


but still most things work anyway so still fun.


hum ... indeed most of the native samples in android are using 
java helper classes


do you still plan to add the ability to create java classes in D 
for non-android projects ?
(ui callbacks, that's where i paused in my non-Android test, also 
in this project i made "GlobalRef"s to reuse java objects / 
classes - thanks for warmly warning about the possible wreckage)


(btw, though good to know the trick, in fact i don't need the 
sourceSets instruction for the jniLibs, i forgot to put the 
library in the right subfolder ... "x86" or "armeabi-v7a", etc...)






Re: My Android project nearing beta

2020-01-04 Thread visitor via Digitalmars-d-announce

On Saturday, 4 January 2020 at 16:59:13 UTC, visitor wrote:
On Thursday, 2 January 2020 at 20:36:46 UTC, Adam D. Ruppe 
wrote:


Getting there. I think I have a plan for making new Java 
classes from D too that I'll play with when I get more time...


Your createJVM() setup works fine on my little experiment !
Not a single line of java! wow ! very Nice :))




Re: My Android project nearing beta

2020-01-04 Thread visitor via Digitalmars-d-announce

On Thursday, 2 January 2020 at 20:36:46 UTC, Adam D. Ruppe wrote:


Getting there. I think I have a plan for making new Java 
classes from D too that I'll play with when I get more time...


!!!   You tried very hard to blow up the whole thing !
Sorry, nope ! still running fine :)

i didn't try the new automated setup, though, but your jni.d 
works fine, both on the test android app and my little experiment 
with "normal" java (using regular dmd - 2.089.1 - there, btw)

Thanks :)



Re: My Android project nearing beta

2020-01-02 Thread visitor via Digitalmars-d-announce

On Wednesday, 1 January 2020 at 18:15:32 UTC, Adam D. Ruppe wrote:

i see you updated everything ! wow !! :))

just a note : i had to add a sourceSets instruction
```
android {
...
defaultConfig {
...
}
sourceSets {
main {
// let gradle pack the shared library into apk
jniLibs.srcDirs = ['./src/main/jniLibs']
}
}
...
}
```
in the build.gradle file (the one in app directory) of the test 
application


it didn't pack the library in the apk otherwise, in my setup 
(which is plain basic, probably not relevant anyway)






Re: My Android project nearing beta

2020-01-01 Thread visitor via Digitalmars-d-announce

On Wednesday, 1 January 2020 at 16:48:07 UTC, Adam D. Ruppe wrote:

On Wednesday, 1 January 2020 at 12:44:30 UTC, visitor wrote:
i managed to run the test app on my phone via Android Studio 
:))


Nice! I just realized that I forgot to commit some of the files 
so cool that you got it working despite me :)


indeed :))
so to reply : i fortunately had a bit of (very recent) 
understanding about D/Android setup and stumbling upon the link 
crash without main() i figured that the main() hack was part of 
the missing files ... i went, like that, by guess and trial 
filling the holes :))


As for the second hack which caused me problems too, obviously, i 
found that if i put the D classes inheriting from your JavaClass 
each in their own files the problem disappears ...

everything compiles and run !
(i have a bunch of "R_ARM_TLS_LDO32 used with non-TLS symbol" 
warnings, though, at link time ... - i compile for armv7a only - )


Btw, with your work i can launch and work from D with libreoffice 
documents !
The exercice is silly because i use D to manipulate java to drive 
uno code (and probably C++)  but it works ! :))  (i will try to 
use your createJVM setup when i have time)


Re: My Android project nearing beta

2020-01-01 Thread visitor via Digitalmars-d-announce

On Monday, 16 December 2019 at 21:37:51 UTC, Adam D. Ruppe wrote:

I'm gonna drop the link here without further comment:

https://github.com/adamdruppe/d_android

hopefully I've written enough in the repo so anyone who wants 
to play with it can... and if not, I need to fix the docs :)


let me know if you find any success or failure playing with it.



Thank you very much, Sir
i managed to run the test app on my phone via Android Studio :))

https://framapic.org/JHDQ9v9AnsXj/XOscSF4YieDR.png


Re: reduxed - Redux for D

2018-08-23 Thread visitor via Digitalmars-d-announce
On Thursday, 23 August 2018 at 19:48:19 UTC, Robert burner 
Schadek wrote:
After working some with Angular and ngrx/store I really came to 
like the redux pattern.
Unfortunately, I couldn't find a package on code.dlang.org that 
filled that spot when coming back to D.

So I build my own.

It is called reduxed.
If you're interested you can find reduxed here 
https://code.dlang.org/packages/reduxed and 
https://github.com/burner/reduxed.


It is still rough around the corners and 
https://issues.dlang.org/show_bug.cgi?id=19084 gives me 
somewhat of a hard time, but give it try and scream at me 
because it is not nogc.


Thank you :)
as for the hard timer : https://run.dlang.io/is/Bsf8Us
Works if struct Foo is defined in the scope of struct Bar(T) ?


Re: Updated LDC snap package with improved Ubuntu 14.04 support

2017-02-19 Thread visitor via Digitalmars-d-announce
On Sunday, 19 February 2017 at 11:24:17 UTC, Joseph Rushton 
Wakeling wrote:
Revision 4 of the ldc2 snap package is now available in the 
'edge' channel of the snap store.


Works for me on ubuntu 16.04 (llvm-3.8), Thanks :-)
Not heavily tested, just to let you know for some feedback on 
your work, again Thanks





Re: let (x,y) = ...

2015-11-24 Thread visitor via Digitalmars-d-announce

On Tuesday, 24 November 2015 at 05:45:55 UTC, thedeemon wrote:
Well, I believe it's a matter of taste. By allowing different 
number of elements there you allow more errors to sink in 
without gaining anything at all. You lose the choice between 
strict and loose operators, erase the difference. It's not the 
"consistency" I would like to have.


ok, always curious about strategic choices, thanks :-)


Re: let (x,y) = ...

2015-11-23 Thread visitor via Digitalmars-d-announce

On Monday, 23 November 2015 at 20:10:49 UTC, visitor wrote:

Andrea Fontana(s allows
let (hello, world) = ["hi", "there", "!"];


of course in your version let (hello, world)[] = ["hi", "there", 
"!"] works

but for consistency with range, i think Fontana's note is relevant


Re: let (x,y) = ...

2015-11-23 Thread visitor via Digitalmars-d-announce

On Monday, 23 November 2015 at 18:38:45 UTC, thedeemon wrote:

let (hello, world)[] = arr;


i think what Andrea Fontana is talking is the other way around
your solution allows
let (hello, world)[] = ["hi"];

Andrea Fontana(s allows
let (hello, world) = ["hi", "there", "!"];


Re: let (x,y) = ...

2015-11-23 Thread visitor via Digitalmars-d-announce

On Monday, 23 November 2015 at 16:58:43 UTC, Andrea Fontana wrote:
Nice. Why first enforce is "==" rather than ">=" ? This 
prevents something like:


auto arr = ["hello", "world", "!"];
string hello;
string world;

let (hello, world) = arr;


note that this is thedeemon's work ! (sorry couldn't resist)

anyway, yes indeed !


Re: let (x,y) = ...

2015-11-23 Thread visitor via Digitalmars-d-announce

On Monday, 23 November 2015 at 14:54:15 UTC, thedeemon wrote:
Yep, this way it works too, by capturing input vars in a 
closure. So the main difference is that your variant allocates 
GC memory while original variant does not allocate anything in 
the heap (only on stack).


Thanks for clarifying :-)
hope this will end into the language ! great work.


Re: let (x,y) = ...

2015-11-23 Thread visitor via Digitalmars-d-announce

On Monday, 23 November 2015 at 10:28:53 UTC, thedeemon wrote:

On Sunday, 22 November 2015 at 18:47:34 UTC, visitor wrote:


What is the reason for using pointers (alias pointerOf(T) = T*
 etc...)
it works without ! what am i missing ?


What and how exactly works without?
My original solution remembers in the constructor addresses of 
variables to fill, then does the filling in opAssign operator, 
so I needed a way to store the references and used pointers for 
that.


yes, but you are using ref : "auto let(Ts...)(ref Ts vars)"
so vars are changed, no need to store anything, no?
i was wondering if there is some subtleties or efficiency reasons 
for using pointers


this work fine with your unittest :
auto let(Ts...)(ref Ts vars) {
struct Let
{
void opAssign( Tuple!Ts xs ) {
foreach(i, t; Ts)
vars[i] = xs[i];
}

static if (sameTypes!Ts) {
import std.conv : text;
void opAssign(Ts[0][] xs) { // redundant but more 
effective
enforce(xs.length == Ts.length, "let (...) = ...: 
array must have " ~ Ts.length.text ~ " elements.");

foreach(i, t; Ts)
vars[i] = xs[i];
}

void opAssign(R)(R xs) if (isInputRange!R && 
is(ElementType!R == Ts[0])) {

static if (hasLength!R) {   
enforce(xs.length >= Ts.length, "let (...) = 
...: range must have at least " ~ Ts.length.text ~ " elements.");

}
foreach(i, t; Ts) {
enforce(!xs.empty, "let (...) = ...: range 
must have at least " ~ Ts.length.text ~ " elements.");

vars[i] = xs.front;
xs.popFront();
}
}

void opIndexAssign(R)(R xs) if (isInputRange!R && 
is(ElementType!R == Ts[0])) {

foreach(i, t; Ts) {
if(xs.empty) return;
vars[i] = xs.front;
xs.popFront();
}
}
}
}
return Let();
}


Re: let (x,y) = ...

2015-11-22 Thread visitor via Digitalmars-d-announce

hello,
Learning here, hope i don"t excavate unnecessarily an old post

What is the reason for using pointers (alias pointerOf(T) = T*  
etc...)

it works without ! what am i missing ?

Thanks