public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Jamison Hope <jrh@theptrgroup.com>
To: "kawa@sourceware.org list" <kawa@sourceware.org>
Subject: [patch] set setter for array-ref to array-set!
Date: Sun, 01 Mar 2015 04:12:00 -0000	[thread overview]
Message-ID: <3100F387-4E57-4C91-B7CB-FBFF61379A4A@theptrgroup.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

Here's a patch which sets the setter property of array-ref to array-set!.

(let ((a (make-array
            (shape 4 5 4 5 4 5))))
   (set! (array-ref a 4 4 4) "huuhkaja")
   (array-ref a 4 4 4))

=> "huuhkaja"

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



[-- Attachment #2: array-ref-setter.patch --]
[-- Type: application/octet-stream, Size: 922 bytes --]

Index: gnu/kawa/functions/ArrayRef.java
===================================================================
--- gnu/kawa/functions/ArrayRef.java	(revision 8360)
+++ gnu/kawa/functions/ArrayRef.java	(working copy)
@@ -8,6 +8,9 @@
 public class ArrayRef extends ProcedureN
 {
   public static final ArrayRef arrayRef = new ArrayRef();
+    static {
+        arrayRef.setSetter(ArraySet.arraySet);
+    }
 
   public static Object arrayRef(Array array, Sequence index)
   {
Index: gnu/kawa/functions/ChangeLog
===================================================================
--- gnu/kawa/functions/ChangeLog	(revision 8360)
+++ gnu/kawa/functions/ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2015-02-28  Jamison Hope  <jrh@theptrgroup.com>
+
+	* ArrayRef.java (arrayRef): Set setter property to ArraySet.arraySet.
+
 2015-02-28  Per Bothner  <per@bothner.com>
 
 	* CompileMisc.java: Remove unneeded call to code.emitTryEnd.

             reply	other threads:[~2015-03-01  4:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-01  4:12 Jamison Hope [this message]
2015-03-02 20:09 ` Per Bothner
2015-03-05  7:54   ` Jamison Hope
2015-03-06 19:15     ` Per Bothner
2015-03-07  6:30       ` Jamison Hope

Reply instructions:

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

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

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3100F387-4E57-4C91-B7CB-FBFF61379A4A@theptrgroup.com \
    --to=jrh@theptrgroup.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).