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.

Of course, you are both right... I was referring to the case that Brandon dealt with, where one or more of the values was not given a "default". However, I had misread his message (taking it as saying that his syntax would give a compilation error).

My question is well and fully answered. Thanks, everybody!
Mike





On Wed, Sep 24, 2008 at 9:01 PM, Brandon S. Allbery KF8NH <allbery@ece.cmu.edu> wrote:
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.com
system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH