public inbox for [email protected]  
help / color / mirror / Atom feed
From: Kartik Ohri <[email protected]>
To: Chapman Flack <[email protected]>
Cc: [email protected]
Subject: Re: the ScriptingMojo
Date: Sat, 22 Aug 2020 15:45:01 +0530
Message-ID: <CAASLQ4NGoruXs1+fNsXnsic7cRjqceJ-PiYofG-OMPUWnxDjWA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAASLQ4Mva7dAXiS_c9OLhV4VzNHF=XNKJosuS5gtZTB6b4TW1Q@mail.gmail.com>
	<[email protected]>
	<CAASLQ4M0uvNj0EyMWWNsizT1KtnWx0WFbk89ud9EVHZbu12LMg@mail.gmail.com>
	<[email protected]>
	<CAASLQ4M3pR+ZL+uPvcQ-dAEL2KdH_PGe-_pBhsjvOgN5qvf+aA@mail.gmail.com>
	<[email protected]>
	<CAASLQ4NU9v=nuLDG-LneC68LuqKRXchFckU7mCZT9YQDNKqwvg@mail.gmail.com>
	<[email protected]>
	<CAASLQ4NgH+tXbdUSA8xDh2ct3gAS3xa8V7=E0gcYd+d=m8kujw@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAASLQ4PEgo5Nj0EVsOfGoB96dQFXfFYxrrB0rS1wdad7x_E5fA@mail.gmail.com>
	<CAASLQ4OowXOmnbbbT0Wh1ZkB4h=6JQfC61ojmN07EYnO0QCcow@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

>
> - I was thinking of simplifying the parameters to processBuilder, to not
>   need the caller to separately pass the command string and a list of the
>   rest of the arguments. An idea that just hit me was why not just
>   processBuilder(Consumer<List<String>>)? A script could use it like:
>
>   var pb = processBuilder(function(l) {
>     l.add(command);
>     l.addAll(stuff);
>     l.add(thing);
>     ...
>   });
>
>   so the script would avoid the messiness of allocating its own ArrayList
>   and so on. On the Java side that's just
>
>   pb = new ProcessBuilder();
>   callback.accept(pb.command());
>   ...
>   return pb;
>

Hi!
I am working adding these changes but I am particularly stuck at this one.
It seems that Nashorn and Graal do not support SAM inside SAM or I am doing
this the wrong way. Please see https://www.ideone.com/cQVGuB and
https://www.ideone.com/1x7Ah7. The former one fails at runtime but the
latter completes execution. (Here I have done a Consumer<Function, ?>
whereas Function<Consumer, ?> will be required for our use case, but both
fail at runtime anyways). This is the commit (
https://github.com/amCap1712/pljava/commit/136a8e879951432ec47faeb74e2a86e848481e67)
with changes that fails. I have been able to work around the issue using
the approach here
https://github.com/amCap1712/pljava/commit/d5977c5cf386758fb2d9e56524b05f9549cefe31
.

Regards,
Kartik


view thread (78+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: the ScriptingMojo
  In-Reply-To: <CAASLQ4NGoruXs1+fNsXnsic7cRjqceJ-PiYofG-OMPUWnxDjWA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox