| Deutsch English Français Italiano |
|
<670c682c$0$705$14726298@news.sunsite.dk> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!usenet.goja.nl.eu.org!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Sun, 13 Oct 2024 20:39:08 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Text processing on VMS
Newsgroups: comp.os.vms
References: <8734l0t56u.fsf@lucy.meyer21c.net> <veh45h$pplr$1@dont-email.me>
<veh575$q0bo$1@dont-email.me> <veh6s8$pplq$1@dont-email.me>
<vehhae$rkn7$1@dont-email.me> <vehnou$sitc$1@dont-email.me>
Content-Language: en-US
From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk>
In-Reply-To: <vehnou$sitc$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 35
Message-ID: <670c682c$0$705$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: ae8de378.news.sunsite.dk
X-Trace: 1728866348 news.sunsite.dk 705 arne@vajhoej.dk/68.14.27.188:50067
X-Complaints-To: staff@sunsite.dk
Bytes: 1865
On 10/13/2024 8:14 PM, Arne Vajhøj wrote:
> It is not Java but Groovy, so compile is optional.
The difference is all in the wrapping though.
$ type P.java
import java.nio.file.Files;
import java.nio.file.Paths;
public class P {
public static void main(String[] args) throws Exception {
Files.lines(Paths.get("login.com"))
.filter(line -> line.contains("java"))
.map(line -> line.substring(2, 13))
.forEach(System.out::println);
}
}
$ type s.groovy
import java.nio.file.*
Files.lines(Paths.get("login.com"))
.filter(line -> line.contains("java"))
.map(line -> line[2..12])
.forEach(System.out::println)
$ javac P.java
$ java P
....
$ groovy s.groovy
....
(I don't even have groovysh defined on VMS, so no easy way to try -e)
Arne