February 28, 2014
Am 28.02.2014 13:15, schrieb Bienlein:
> On Thursday, 27 February 2014 at 17:16:54 UTC, Paulo Pinto wrote:
>> Yep, that is how for example .NET, Eiffel, Smalltalk, Lisp and many
>> other languages work.
>
> An object in Smalltalk is not a primitive type. Even ints, floats,
> chars, etc. in Smalltalk are no primitive types but objects. Not wanting
> to be a rogue. Just pointing out ;-).
>

Yes they are, kind of, because the ones small enough to fit in registers, like SmallInteger are converted to primitive types by the JIT.

The programmer cannot see it, because it is considered an implementation detail, likewise in the other environments I mentioned.

--
Paulo
March 01, 2014
On 2014-02-27 21:43, Walter Bright wrote:

> This comes up now and then. The problem with it is it makes function
> overloading a near impossibility to untangle.

We could quite easy add support for named parameters but still require using the same position of the arguments. I don't know if those wanting named parameters would be satisfied with this though.

-- 
/Jacob Carlborg
March 01, 2014
Jacob Carlborg:

> We could quite easy add support for named parameters but still require using the same position of the arguments. I don't know if those wanting named parameters would be satisfied with this though.

I think requiring the same position of the arguments goes against one of the main points of having named arguments.

A (temporarily?) solution to Walter's problem (has someone shown examples of the problem?) is to just not allow the use of named arguments for overloaded functions. This is not a large problem because when you have named arguments, you have less need for function overloading.

Bye,
bearophile
March 01, 2014
On 2014-03-01 15:19:29 +0000, Jacob Carlborg <doob@me.com> said:

> On 2014-02-27 21:43, Walter Bright wrote:
> 
>> This comes up now and then. The problem with it is it makes function
>> overloading a near impossibility to untangle.
> 
> We could quite easy add support for named parameters but still require using the same position of the arguments. I don't know if those wanting named parameters would be satisfied with this though.

I did implement something like that in DMD a while ago as an experiment. See the comments below that commit:

https://github.com/michelf/dmd/commit/673bae4982ff18a3d216bc1578f50d40f4d26d7a

Walter pointed out that it should work for template arguments. I agreed, devised a plan to restructure the whole thing to be less of a hack and make it works for templates, then I had no more time to put on this. :-(

This planned restructuring did lead to a transition to type-checked arrays within DMD though, so the effort wasn't completely wasted.


-- 
Michel Fortin
michel.fortin@michelf.ca
http://michelf.ca

March 01, 2014
On Friday, 28 February 2014 at 12:12:38 UTC, bearophile wrote:
> Chris:
>
>>   Every time I write something in JS, I feel like a complete programming novice,
>
> Probably that's part of the problem. More experience in a language helps.
>
> I suggest to use TypeScript (http://www.typescriptlang.org/ ), it has static types, more Java-style classes, better modules, and more; that give a more tidy and ordered kind of coding. If JavaScript gains integers too, programming in TypeScript probably becomes bearable even for die hard D programmers :-)
>
> Bye,
> bearophile

And now with full(native, i.e., not using a plug-in) support in Visual Studio 2013 check out http://blogs.msdn.com/b/mvpawardprogram/archive/2013/11/13/typescript-support-in-visual-studio-2013.aspx ;)
March 01, 2014
On 2014-03-01 17:19, Michel Fortin wrote:

> I did implement something like that in DMD a while ago as an experiment.
> See the comments below that commit:
>
> https://github.com/michelf/dmd/commit/673bae4982ff18a3d216bc1578f50d40f4d26d7a

I based the "quite easy" on the few changes needed in your implementation.

> Walter pointed out that it should work for template arguments. I agreed,
> devised a plan to restructure the whole thing to be less of a hack and
> make it works for templates, then I had no more time to put on this. :-(

That happens too often :(

> This planned restructuring did lead to a transition to type-checked
> arrays within DMD though, so the effort wasn't completely wasted.

Nice :)

-- 
/Jacob Carlborg
March 01, 2014
On Saturday, 1 March 2014 at 16:37:36 UTC, Asman01 wrote:
> On Friday, 28 February 2014 at 12:12:38 UTC, bearophile wrote:
>> Chris:
>>
>>>  Every time I write something in JS, I feel like a complete programming novice,
>>
>> Probably that's part of the problem. More experience in a language helps.
>>
>> I suggest to use TypeScript (http://www.typescriptlang.org/ ), it has static types, more Java-style classes, better modules, and more; that give a more tidy and ordered kind of coding. If JavaScript gains integers too, programming in TypeScript probably becomes bearable even for die hard D programmers :-)
>>
>> Bye,
>> bearophile
>
> And now with full(native, i.e., not using a plug-in) support in Visual Studio 2013 check out http://blogs.msdn.com/b/mvpawardprogram/archive/2013/11/13/typescript-support-in-visual-studio-2013.aspx ;)

As soon as Microsoft releases a Linux version I will be sure to try it out :o)
March 01, 2014
On Saturday, 1 March 2014 at 18:57:03 UTC, Craig Dillabaugh wrote:
> On Saturday, 1 March 2014 at 16:37:36 UTC, Asman01 wrote:
>> On Friday, 28 February 2014 at 12:12:38 UTC, bearophile wrote:
>>> Chris:
>>>
>>>> Every time I write something in JS, I feel like a complete programming novice,
>>>
>>> Probably that's part of the problem. More experience in a language helps.
>>>
>>> I suggest to use TypeScript (http://www.typescriptlang.org/ ), it has static types, more Java-style classes, better modules, and more; that give a more tidy and ordered kind of coding. If JavaScript gains integers too, programming in TypeScript probably becomes bearable even for die hard D programmers :-)
>>>
>>> Bye,
>>> bearophile
>>
>> And now with full(native, i.e., not using a plug-in) support in Visual Studio 2013 check out http://blogs.msdn.com/b/mvpawardprogram/archive/2013/11/13/typescript-support-in-visual-studio-2013.aspx ;)
>
> As soon as Microsoft releases a Linux version I will be sure to try it out :o)

Well, you will need to wait a while. :P

1 2 3 4
Next ›   Last »