Difference between []New and .New

Writing and using Classes in Dyalog APL

Difference between []New and .New

Postby RobertB on Thu Nov 22, 2012 3:36 pm

Hello,

we are using Dyalog 12.0 in our Web-Applications.
Is there a difference in creating an object with []New and .New?
Both is working.

Example:
DateTime.New 2012 11 22
[]New DateTime 2012 11 22

Regards
Robert
RobertB
 
Posts: 15
Joined: Fri Aug 27, 2010 7:16 am

Re: Difference between []New and .New

Postby Vince|Dyalog on Tue Nov 27, 2012 9:51 am

Hi Robert,

We recommend using the ⎕new way.

In the end, they are the same but there is potential for a clash if the class already had it's own New method.

Regards,

Vince
Vince|Dyalog
 
Posts: 432
Joined: Wed Oct 01, 2008 9:39 am

Re: Difference between []New and .New

Postby RobertB on Wed Nov 28, 2012 12:52 pm

Thanks Vince
RobertB
 
Posts: 15
Joined: Fri Aug 27, 2010 7:16 am


Return to Object Oriented Programming

Who is online

Users browsing this forum: No registered users and 0 guests