When a variable is passed into a function, is its name kept somewhere for the function to acceess

2015-11-10 Thread DlangLearner via Digitalmars-d-learn
Here is what I want to know: when a function is called, does this function can recovery the information about which variables pass their values into this function's arguments. I use the following example to show what I want to know. void main(){ int a = 1; writeln(fun(a.stringo

Re: When a variable is passed into a function, is its name kept somewhere for the function to acceess

2015-11-10 Thread DLangLearner via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 14:22:49 UTC, Gary Willoughby wrote: On Tuesday, 10 November 2015 at 14:14:33 UTC, DlangLearner wrote: Please enlighten me if this can be done, thanks. If i understand you, you could use a templated function: import std.stdio; void foo(alias a)() { writefl

Calling DLL coded in D from Java

2015-06-16 Thread DlangLearner via Digitalmars-d-learn
I'd like to know if it is possible to call an DLL coded in D from Java? I don't have any knowledge on DLL calling mechanism, so I am wondering if this is possible or any special procedure should be followed. I indeed tried a small example but didn't succeed. First I created an DLL from the te

Replacement of std.stream

2015-06-27 Thread DlangLearner via Digitalmars-d-learn
I will convert a Java program into D. The original Java code is based on the class RandomeAccessFile which essentially defines a set of methods for read/write Int/Long/Float/String etc. The module std.stream seems to be a good fit for this job, but in its documentation, it is marked deprecated.

How to convert byte array to float

2015-07-17 Thread DLangLearner via Digitalmars-d-learn
Excuse me for my trivial question, but I'd like to know how to convert byte array to float? What I could think of are cast(float)(byte[]) and to!float(byte[]) but they do not work for me. Thanks!

Re: How to convert byte array to float

2015-07-17 Thread DLangLearner via Digitalmars-d-learn
On Friday, 17 July 2015 at 18:58:33 UTC, byron wrote: On Friday, 17 July 2015 at 18:53:24 UTC, byron wrote: On Friday, 17 July 2015 at 18:43:27 UTC, DLangLearner wrote: Excuse me for my trivial question, but I'd like to know how to convert byte array to float? What I could think of are cast(fl

Re: I'll like to learn D

2015-09-19 Thread DlangLearner via Digitalmars-d-learn
On Saturday, 19 September 2015 at 17:42:50 UTC, uNknow123 wrote: On Saturday, 19 September 2015 at 15:09:38 UTC, WhatMeWorry wrote: On Saturday, 19 September 2015 at 13:41:03 UTC, uNknow123 wrote: Hi! I'll like to learn D Lang. I knew some Pawn, it is pretty similar, but not so similar, if you

Compile time and runtime grammars

2015-10-10 Thread DLangLearner via Digitalmars-d-learn
Only now I found that most of my confusions are with D's compile time grammar or features. As an excuse, my confusions can be partially attributed to the way D is presented: 1. There are confusing keywords: For example, there is a "if", there is also a "static if", there is a "if", and there i