[Swift-user] structured_regexp_mapper does not work

Michael Wilde wilde at anl.gov
Sun May 4 18:35:57 CDT 2014


On 5/4/14, 4:45 PM, Kamil Slowikowski wrote:
> I cannot reproduce the example in the user guide:
>
> http://swift-lang.org/guides/release-0.94/userguide/userguide.html#_structured_regular_expression_mapper
>
> Please see the script and console output below.

Kamil, thanks for reporting this.

Im not yet certain, but I think the example should be recoded to make 
the source (in addition to the dest) array be an array of type file 
rather than of type string, and also to trace @filenames( ) of the dest 
file array rather than the whole array:

$ cat test2.swift

type file;
string s[] = ["picture.gif", "hello.gif", "world.gif"];

file g[]<array_mapper; files=s>;
file f[] <structured_regexp_mapper;
             source=g,
             match="(.*)gif",
             transform="\\1jpg">;
trace(@filenames(f));

$ swift test2.swift
Swift 0.94.1 swift-r7114 cog-r3803

RunID: 20140504-2309-rfdo9614
Progress:  time: Sun, 04 May 2014 23:09:21 +0000
SwiftScript trace: {0 = picture.jpg, 1 = hello.jpg, 2 = world.jpg}
Final status: Sun, 04 May 2014 23:09:21 +0000

I filed a bug ticket (#1271) to fix the exception, determine the 
(currently) desired behavior, and update the User Guide:

   https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1271
>
> 1. Is Swift currently being developed?
Yes, actively.
> 2. Are there plans to improve the documentation soon?
Yes - this need is well-recognized. The User Guide improves but rather 
slowly. I can't provide a date when this will start accelerating.
> 3. Is it possible to move the documentation to a platform where your users
> can contribute?
Yes, that's a good idea. We are planning a move to GitHub. We were a bit 
more focused on enabling users to contribute to code, but enabling user 
documentation contributions more readily is a great idea. Our docs are 
currently written in AsciiDoc; we'll look for ways to do this, but for 
now, just mail improvement text to swift-user.  (Ideally, please join 
the swift-user list so that your posts are not blocked for moderation).
> 4. Is the project well-funded and staffed?
We're very grateful for the funding we have, but its barely enough to 
support our user base.  About 7 people work on Swift, under relatively 
modest funding. Less than 1.5 FTE is available to support of the Swift 
0.9 -> 1.0 product trajectory; the rest of the team is funded to do CS 
research or support specific science application user groups.  We're 
actively pursuing expanded funding and other means of sustaining Swift, 
including working more aggressively to grow a sustaining open source 
community.

- Mike
>
> Thanks,
> Kamil
>
>
> Here is the script: (copied from the guide verbatim)
>
> - - -
> $ cat test.swift
> type file;
> string s[] = ["picture.gif", "hello.gif", "world.gif"];
> file f[] <structured_regexp_mapper;
>              source=s,
>              match="(.*)gif",
>              transform="\\1jpg">;
> trace(f);
> - - -
>
>
> Here is the output:
>
> - - -
> $ swift test.swift
> Swift 0.94.1 swift-r7114 cog-r3803
>
> RunID: 20140504-1718-q5qk8b9a
> Progress:  time: Sun, 04 May 2014 17:18:24 -0400
> Execution failed:
>          f, line 3 had mapping errors
> Caused by:
>          java.lang.NullPointerException
>          at
> org.griphyn.vdl.mapping.file.StructuredRegularExpressionMapper.map(StructuredRegularExpressionMapper.java:106)
>          at
> org.griphyn.vdl.mapping.RootDataNode.addExisting(RootDataNode.java:173)
>          at
> org.griphyn.vdl.mapping.RootDataNode.checkInputs(RootDataNode.java:128)
>          at
> org.griphyn.vdl.mapping.RootArrayDataNode.checkInputs(RootArrayDataNode.java:104)
>          at
> org.griphyn.vdl.mapping.RootArrayDataNode.innerInit(RootArrayDataNode.java:92)
>          at
> org.griphyn.vdl.mapping.RootArrayDataNode.futureModified(RootArrayDataNode.java:113)
>          at
> org.griphyn.vdl.karajan.ArrayIndexFutureList$1.run(ArrayIndexFutureList.java:156)
>          at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>          at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>          at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>          at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>          at java.lang.Thread.run(Thread.java:662)
> - - -
>
>
>
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user

-- 
Michael Wilde
Mathematics and Computer Science          Computation Institute
Argonne National Laboratory               The University of Chicago

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


More information about the Swift-user mailing list