#231 Build 1.0.27

brian Thu 29 May 2008

The latest build is posted and the online docs updated. Lots of goodies:

Email

The biggest new feature is support for sending email via SMTP. To learn more:

You can send multi-part MIME emails which (in my humble opinion) really shows off the strength of Fan's ability to do declarative style programming:

// create simple plain text email
email := Email
{
  to = ["[email protected]"]
  from = "[email protected]"
  subject = "hi"
  body = TextPart { text = "hello world" }
}

// configure smtp mailer and send email
mailer := SmtpClient { host = "mail.foo.com"; username = "bob"; password = "pw" }
mailer.send(email)

As part of the email feature, I added some new sys APIs:

Well Known Services

Threads can now publish themselves as a service which means they can be looked up by type. Services are published into the namespace via the URI "/sys/services/{qname}". See discussion.

Native and Non-storage Fields

I relaxed the rules for fields used in const classes. This includes the following breaking API changes:

  • Log.setLevel => level
  • File.setModified => modified

Both of these methods where changed into fields. See discussion.

Try, Catch, Finally

These blocks can now use a single statement or a {} block (just like if, for, while). See discussion.

// old way
try
{
  somethingDangerous
}
catch (Err e)
{
  e.trace
}

// optional new way
try
  somethingDangerous
catch (Err e)
  e.trace

Change Log

Build 1.0.27 (28 May 08)

  • Fix this return for mixins
  • Sanity check for bootstrap build
  • sys::MimeType, Uri.mimeType, File.mimeType
  • New email pod for MIME and SMTP support
  • Charset.make => fromStr (now serializable simple)
  • Thread.isService, findService
  • Fix fandoc blockquotes
  • Native fields
  • Allow non-storage fields in const class
  • Fix constructor, field init ordering
  • Allow single statement for try, catch, finally
  • Log.setLevel() => Log.modified
  • File.setModified() => File.modified

Login or Signup to reply.