octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39420] object2json doesn't support logical ty


From: anonymous
Subject: [Octave-bug-tracker] [bug #39420] object2json doesn't support logical types
Date: Sun, 07 Jul 2013 16:07:05 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?39420>

                 Summary: object2json doesn't support logical types
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Sun 07 Jul 2013 04:07:04 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Keith Sheppard
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: other
        Operating System: Mac OS

    _______________________________________________________

Details:

I added logical support to my local copy of object2json.m by adding the
following case


diff --git a/object2json.m b/object2json.m
index f0bdb87..4df9b34 100644
--- a/object2json.m
+++ b/object2json.m
@@ -98,6 +98,13 @@ function json = object2json (object)
         object = replace_non_JSON_escapes (object);
         json = [ '"', object, '"' ];
 
+      case 'logical'
+        if object
+          json = 'true';
+        else
+          json = 'false';
+        endif
+
       otherwise
         % We don't know what is it so we'll put the class name
         json = [ '"', class(object), '"' ];






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39420>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]