Re: dfix 0.1.1

2014-10-28 Thread Brian Schott via Digitalmars-d-announce
On Wednesday, 29 October 2014 at 02:10:09 UTC, Andrei 
Alexandrescu wrote:

Cool! Is it idempotent if ran twice? -- Andrei


It should be. If you find a case where running dfix on the output 
of dfix causes a change, please file an issue on Github.




Re: dfix 0.1.1

2014-10-28 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 10/27/14 6:29 PM, Brian Schott wrote:

No. Really. I'm serious.

https://github.com/Hackerpilot/dfix

dfix is a tool for automatically upgrading older D syntax to the newer
style.

* Updates old-style alias syntax to new-style
* Fixes implicit concatenation of string literals
* Automatic conversion of C-style array declarations and parameters to
D-style.
* Upgrades code to comply with DIP64 if the --dip64 switch is specified.
(You
   probably don't want to use this)
* Upgrades code to comply with DIP65 unless the --dip65=false switch is
specified.


Cool! Is it idempotent if ran twice? -- Andrei


Re: dfix 0.1.1

2014-10-28 Thread Orfeo via Digitalmars-d-announce

Thank you very much Brian...


Re: D/Objective-C 64bit

2014-10-28 Thread Jacob Carlborg via Digitalmars-d-announce

On 2014-10-27 19:03, Christian Schneider wrote:

Can somebody with a greater d-objc knowledge have a look at this example
project and tell this naive D-noob what he is missing?

https://github.com/DiveFramework/DiveFramework/tree/master/Examples/Tableview


I am pretty sure that it has something to do with memory management and
ARC. First it all starts up right, but then a delegate method get's
called in the wild and some memory segmentation is occurring calling
objectAtIndex, which is called on very different objects on multiple
runs, and I cannot get any closer to the real issue.

NSMutableArray _applications ;

is the main culprit, in this I am trying to put some NSObject subclass
objects. I have to admit that my mind is all Objective-C and very little
D yet, and probably the solution is very simple. What I have further
found is, that the crash occurs in relation to the visible table cells.
As soon as a view for an invisible cell is requested, the seg fault
occurs. I am trying to elaborate a TableView example using View based
cells.

To compile the program, you only need to execute "dub" in the
Examples/Tableview directory, of course assuming you have the latest
d-objc branch dmd installed and dub (and Xcode, I am using 5.1.1 but 6
should work just as well).


I tried running your code and could observe the behavior. Although I 
have not been able to figure you why it behaves like this. In general 
there are a couple of things to think of and watch out for when 
interfacing between D and Objective-C :


* The D compiler does not support any form of ARC, it's back to using 
retain/release


* When allocating memory with the GC in D and passing it to Objective-C 
(or C for that matter) you have to make sure there is still a root 
pointing to the memory. This can either be a variable that is still in 
scope or by explicitly adding a new root by calling core.GC.addRoot.


I don't know if any of the above is the actual problem, but it could be. 
I would recommend trying to contact Michel Fortin how original 
implemented D/Objective-C.


BTW, There is a tool, DStep [1], that can automatically generate 
bindings for Objective-C code.


[1] https://github.com/jacob-carlborg/dstep

--
/Jacob Carlborg


Re: dfix 0.1.1

2014-10-28 Thread Atila Neves via Digitalmars-d-announce

Good work, man.

Atila

On Tuesday, 28 October 2014 at 01:29:32 UTC, Brian Schott wrote:

No. Really. I'm serious.

https://github.com/Hackerpilot/dfix

dfix is a tool for automatically upgrading older D syntax to 
the newer style.


* Updates old-style alias syntax to new-style
* Fixes implicit concatenation of string literals
* Automatic conversion of C-style array declarations and 
parameters to D-style.
* Upgrades code to comply with DIP64 if the --dip64 switch is 
specified. (You

  probably don't want to use this)
* Upgrades code to comply with DIP65 unless the --dip65=false 
switch is specified.




Re: dfix 0.1.1

2014-10-28 Thread bearophile via Digitalmars-d-announce

Brian Schott:


https://github.com/Hackerpilot/dfix


Sounds like a very good start :-)

Bye,
bearophile


Re: dfix 0.1.1

2014-10-28 Thread Daniel N via Digitalmars-d-announce

On Tuesday, 28 October 2014 at 01:29:32 UTC, Brian Schott wrote:

No. Really. I'm serious.

https://github.com/Hackerpilot/dfix

dfix is a tool for automatically upgrading older D syntax to 
the newer style.


* Updates old-style alias syntax to new-style
* Fixes implicit concatenation of string literals
* Automatic conversion of C-style array declarations and 
parameters to D-style.
* Upgrades code to comply with DIP64 if the --dip64 switch is 
specified. (You

  probably don't want to use this)
* Upgrades code to comply with DIP65 unless the --dip65=false 
switch is specified.


Awesome, would be nice if it was included with the default 
install for 2.067+