[Swift-user] array append

Wilde, Michael J. wilde at mcs.anl.gov
Fri Feb 28 08:10:12 CST 2014


Greg, thanks for reporting this.

We can reproduce it and have created a bug ticket:
   https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1207

It seems that this feature was not in the test suite. Will post when we have a fix.

- Mike


From: <Bronevetsky>, Greg <bronevetsky1 at llnl.gov<mailto:bronevetsky1 at llnl.gov>>
Date: Thursday, February 27, 2014 6:31 PM
To: Swift User <swift-user at ci.uchicago.edu<mailto:swift-user at ci.uchicago.edu>>
Subject: [Swift-user] array append

I’m trying to use the array append function in Swift 0.94.1, based on Section 2.3 of the user guide (http://swift-lang.org/guides/release-0.94/userguide/userguide.html)

Given the following program:
int[auto] array;

foreach i in [1:100] {
  append(array, i * 2);
}

I run swift on it and get this following error:
> swift test.swift
Could not start execution
        Compile error in foreach statement at line 3
        Compile error in procedure invocation at line 4
        Procedure append is not declared.

How should I be using the append function to avoid this error? Thank you!

Greg Bronevetsky
Lawrence Livermore National Lab
(925) 424-5756
bronevetsky at llnl.gov<mailto:bronevetsky at llnl.gov>
http://greg.bronevetsky.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20140228/b5901b2e/attachment.html>


More information about the Swift-user mailing list