1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Suggestion Can you please add ds_list_item_is_list/map

Discussion in 'Community Chat' started by icuurd12b42, Nov 10, 2016.

Tags:
  1. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,840
    Getting tired of asking for this! But the missing functions:

    ds_list_item_is_list
    ds_list_item_is_map
    ds_map_item_is_list
    ds_map_item_is_map

    Bit us in the ass yet again!!

    I been asking for these for 2 years!

    Can you please add these to the gml language!!! the missing functions are infuriating...

    You obviously have the ability to give us this information since the debugger itself is aware of the content of the data structure since exploding the root id of a json ds_map also explodes the sub structure!!!

    Jesus, it's only 4 new functions. right now we can't deal with json files without those... aside those files we know exactly the content of.. This is EXTREMELY limiting.
     
  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,699
    And I've also asked for json_encode_list() and json_decode_list() for a long time. With json_decode(), having the outer map with the default key makes it annoying to return the resulting list from a script without leaking or breaking references.

    Seriously, finding the type of nested entries is something that every GML-based JSON library supports. Why not the native one in the runner?
     
    Drewster likes this.
  3. zbox

    zbox Member GMC Elder

    Joined:
    Jun 21, 2016
    Posts:
    796
    If we want to speak on terms of technicalities, that is what the JSON specification requires. If GM supported directly decoding a ds list to a list it would no longer technically fall within the JSON spec. But I acknowledge that it goes outside the json spec in other means (Supports trailing commas, etc) and this is a fairly benign element. But make no mistake its done on purpose, not because someone didnt add it.

    OP's suggestions would also be very very useful :)
     
    Drewster likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice