« Return to Thread: POC Release Announcement for Guilder Build Project

RE: POC Release Announcement for Guilder Build Project

by tugwilson :: Rate this Message:

Reply to Author | View in Thread


Bloois, Rene de wrote:
John,

I'm sure you meant to write

a = 2

for the second assignment to a :)

You are quite right, thanks for the correction (I had not had my first coffee when I posted that!)

John Wilson

PS

there is another use of Closures in GStrings which is slightly more specialised.

If you embed a closure with a single parameter then it is called with a Writer as the parameter every time the GSting is evaluated. Characters write to the Writer will be embedded in the resultant String.

This combines with the behaviour of GStings when they are passed to a Writer (the individual elements of the GString are written in order to the Writer rather than evaluating the GString to a String and writing that to a Writer).

The effect is that you can create GStrings which consist of very large amounts of data (gigabytes) but which can be written out without consuming excessive amounts of memory.

One use for this mechanism is to produce a GString which includes the contents of a file without having to read all the file into memory before writing it out.



 « Return to Thread: POC Release Announcement for Guilder Build Project