kawa improvements for strings and sequences

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

kawa improvements for strings and sequences

Per Bothner
I checked in a number of neat features recently.
Check out the first few sections here:

http://www.gnu.org/software/kawa/news.html

The main still-missing functionality is replacement indexing:
   (set! (seq [i <: j]) new-value)
This would generalize insertion/deletion/replacement.
I have prototype code for this (working for arbitrary java.util.List), but I
need to figure out how to detect and handle if new-value overlaps with seq.

Another issue still unresolved is how to print ranges and indirect-indexing:

#|kawa:1|# [3 <=: 6]
(#sequence 3 4 5 6)

I'm thinking this should display as: [3 4 5 6]
and write as: [3 <: 7]

#|kawa:2|# ([11 12 13 14] [3 2])
(#sequence 14 13)

This should probably print as: [14 13]
--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: kawa improvements for strings and sequences

Jamison Hope

On Jun 12, 2015, at 5:32 PM, Per Bothner <[hidden email]> wrote:

> I checked in a number of neat features recently.
> Check out the first few sections here:
>
> http://www.gnu.org/software/kawa/news.html

They are indeed pretty neat.

> The main still-missing functionality is replacement indexing:
>  (set! (seq [i <: j]) new-value)
> This would generalize insertion/deletion/replacement.
> I have prototype code for this (working for arbitrary java.util.List), but I
> need to figure out how to detect and handle if new-value overlaps with seq.
>
> Another issue still unresolved is how to print ranges and indirect-indexing:
>
> #|kawa:1|# [3 <=: 6]
> (#sequence 3 4 5 6)
>
> I'm thinking this should display as: [3 4 5 6]
> and write as: [3 <: 7]
>
> #|kawa:2|# ([11 12 13 14] [3 2])
> (#sequence 14 13)
>
> This should probably print as: [14 13]

Can we also make it so that open-ended sequences such as [3 <:]
display and write in a finite number of characters?



--
Jamison Hope
The PTR Group
www.theptrgroup.com



Reply | Threaded
Open this post in threaded view
|

Re: kawa improvements for strings and sequences

Per Bothner


On 06/12/2015 04:53 PM, Jamison Hope wrote:
> Can we also make it so that open-ended sequences such as [3 <:]
> display and write in a finite number of characters?

Definitely for write.

For display it's a bit more difficult.  Consider a long-running
application or server that writes out a lazy sequence to stdout.

A related and more general problem is that we don't have a way to stop
a run-away process without killing the JVM. We need a way to interrupt the
current command (whether it is producing tons of output or in an infinite loop
or deadlocked). This means (I think) using the JVM TI (Tool Interface).

Ihis fall I plan to spend a lot of time on the REPL, including working on a
graphical console.  I'm hoping that will include a mechanism to interrupt a
command.

In the interim I guess we could consider a special REPL output mode or other
hacks to limit excessive output.
--
        --Per Bothner
[hidden email]   http://per.bothner.com/