Closed Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: [E2] gvar overhaul

  1. #11
    Success: An illusion turck3's Avatar
    Join Date
    Jun 2007
    Location
    USA
    Posts
    1,744
    Blog Entries
    4

    Default Re: [E2] gvar overhaul

    Wow. Ridiculously better.

  2. #12
    Wire Sofaking feha's Avatar
    Join Date
    Sep 2009
    Location
    Here
    Posts
    1,156

    Default Re: [E2] gvar overhaul

    (From another thread)
    Quote Originally Posted by feha View Post
    The question is though, is your gvars breaking the current e2's? XD
    Quote Originally Posted by Divran View Post
    No, old E2s work fine. I've already tested it.
    I did, however, remove a few functions as well (but not the ones you removed).
    I removed the gSet*(*), gGet*(), and gDelete*(*) functions (the ones with no index arguments) because they were utterly useless. They saved the gvar to a single variable rather than in a table at the specified index. This means 3 extra functions for only 1 variable (per type).

    LIEZ, I tested them, and apparently they do break. My code:

    First E2:
    Code:
    gShare(1)
    gSetStr("test","hello world")
    Second E2:
    Code:
    gShare(1)
    print(gGetStr("test"))

  3. #13
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: [E2] gvar overhaul

    Quote Originally Posted by feha View Post
    (From another thread)





    LIEZ, I tested them, and apparently they do break. My code:

    First E2:
    Code:
    gShare(1)
    gSetStr("test","hello world")
    Second E2:
    Code:
    gShare(1)
    print(gGetStr("test"))
    Works fine for me. Tried that exact same code.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  4. #14
    Banned Buggzie's Avatar
    Join Date
    Dec 2009
    Location
    Under your bed
    Posts
    281
    Blog Entries
    1

    Default Re: [E2] gvar overhaul

    sv: Expression 2 (GunShop Console Screen Controller (Networked)): entities/gmod_wire_expression2/core/globalvars.lua:58: attempt to index global 'gravs' (a nil value)

    Breaks when i do this:

    Code:
            Group = gTable("GunShop")
            CostArray[1,number] = 150
            CostArray[2,number] = 250
            CostArray[3,number] = 300
            CostArray[4,number] = 400
            CostArray[5,number] = 450
            Group["Cost",array] = CostArray
    post merge:

    scratch that.

    If you have gTable("WHOOPDYDOOHERESMYTABLE") your e2 will crash because you have no following number... gTable("Table",0)

    quick little line edit?
    Last edited by Divran; 06-16-2010 at 11:27 AM. Reason: Post merge

  5. #15
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: [E2] gvar overhaul

    Quote Originally Posted by Buggzie View Post
    sv: Expression 2 (GunShop Console Screen Controller (Networked)): entities/gmod_wire_expression2/core/globalvars.lua:58: attempt to index global 'gravs' (a nil value)

    Breaks when i do this:

    Code:
            Group = gTable("GunShop")
            CostArray[1,number] = 150
            CostArray[2,number] = 250
            CostArray[3,number] = 300
            CostArray[4,number] = 400
            CostArray[5,number] = 450
            Group["Cost",array] = CostArray
    post merge:

    scratch that.

    If you have gTable("WHOOPDYDOOHERESMYTABLE") your e2 will crash because you have no following number... gTable("Table",0)

    quick little line edit?
    Make sure you have the latest SVN version of Wiremod.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  6. #16
    Banned Buggzie's Avatar
    Join Date
    Dec 2009
    Location
    Under your bed
    Posts
    281
    Blog Entries
    1

    Default Re: [E2] gvar overhaul

    Quote Originally Posted by Divran View Post
    Make sure you have the latest SVN version of Wiremod.
    i update daily

  7. #17
    Wire Amateur Selig's Avatar
    Join Date
    Jun 2008
    Posts
    58

    Default Re: [E2] gvar overhaul

    Am I the only one not very fond of the Blah["Index", type] syntax? It just "Feels" wrong to me. In most cases the parser should be able to guess the type of variable you are setting/getting, shouldn't it? But then the problem is with how to return that type, since there is no type conversion (From what I recall). I might look into how this can be solved sometime. ~Adds to her massive TODO List~

    EDIT:
    Am I right in the guess that this is the type of thing initrd.gz is trying to solve with the "generic" type he is making? (Though it's not quite there, you still have to pull the type info out yourself)
    Last edited by Selig; 06-16-2010 at 05:04 PM.

  8. #18
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: [E2] gvar overhaul

    Quote Originally Posted by Buggzie View Post
    i update daily
    Code:
    G = gTable("test")
    Tested, works fine.
    Last edited by Divran; 06-17-2010 at 08:27 AM.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  9. #19
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default Re: [E2] gvar overhaul

    Quote Originally Posted by Selig View Post
    Am I the only one not very fond of the Blah["Index", type] syntax? It just "Feels" wrong to me. In most cases the parser should be able to guess the type of variable you are setting/getting, shouldn't it? But then the problem is with how to return that type, since there is no type conversion (From what I recall). I might look into how this can be solved sometime. ~Adds to her massive TODO List~
    It's impossible to solve the way the language currently works, and it's done that way to be fast and simple. Setting the an index doesn't NEED the type, but it's there so that people don't mess up and it keeps the syntax consistent. Issue is not even that there is no type conversion, there can be no implicit type conversion when assigning to variables unless one changes the entire scope-model in E2 and a bunch of other stuff. E2 is statically typed and deduces variable types from assignment, hence, assignment to variables must always have a predefined type... which can only be known if you specify it or return a generic type that is implicitly cast when used (but that opens up a lot of ambiguity and unnecessarily complicates the language).

    Long story short, E2 is statically typed, there is nothing one can do about it without adversely affecting the language.

  10. #20
    Banned Buggzie's Avatar
    Join Date
    Dec 2009
    Location
    Under your bed
    Posts
    281
    Blog Entries
    1

    Default Re: [E2] gvar overhaul

    Quote Originally Posted by Divran View Post
    Code:
    G = gTable("test")
    Tested, works fine.
    not egpTable

    gTable.
    Last edited by Divran; 06-17-2010 at 08:27 AM.

Closed Thread
Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots