On Wed, Sep 24, 2008 at 9:02 PM, Daniel Fischer <daniel.is.fischer@web.de> wrote:
you define your default customer
cust = Customer{ customerID=0, customerName="", customerAddress=Nothing }
On Wed, Sep 24, 2008 at 9:01 PM, Brandon S. Allbery KF8NH <allbery@ece.cmu.edu> wrote:
assuming "aCustomer" and "a" from my previous message: aCustomer is the custom initializer and a is a value initialized from it.
On 2008 Sep 24, at 21:38, Mike Sullivan wrote:defaultCust2 id addr = Customer id "Bill" addr -- function which simulates a default value for "name"
So despite the lack of syntactic sugar, the simplicity and power of functions can make do. One down side, however, is that you lose the flexibility of record syntax (unless there is an analogue for functions that I don't know about).
*Main> aCustomer{customerName = "Bob", customerID = 9}Customer {customerID = 9, customerName = "Bob", customerAddress = Nothing}*Main> a{customerName = "Bob", customerID = 9}Customer {customerID = 9, customerName = "Bob", customerAddress = Nothing}assuming "aCustomer" and "a" from my previous message: aCustomer is the custom initializer and a is a value initialized from it.--brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.comsystem administrator [openafs,heimdal,too many hats] allbery@ece.cmu.eduelectrical and computer engineering, carnegie mellon university KF8NH