Page 3 of 6 FirstFirst 1 2 3 4 5 ... LastLast
Results 21 to 30 of 58

Thread: Map literals in ASH (potential feature)

  1. #21
    Senior Member Winterbay's Avatar
    Join Date
    Feb 2010
    Posts
    5,033

    Default

    That change broke way more scripts than I expected...
    My scripts:
    Best sushi for Profit
    Winterbay's Helpful Automatic Monsterbasher (WHAM)

    Scripts maintained by me:
    Autobasement
    Smashlib

    A small programmer joke:
    Wife: Honey, please go to the market and buy 1 bottle of milk. If they have eggs, bring 6.
    The man came back with 6 bottles of milk.
    Wife: Why did you buy 6 bottles of milk.
    Man: Because they had eggs...

    The 6 Stages of Debugging: 1 )That can't happen. 2) That shouldn't happen. 3) Hmmm, weird. 4) Why does that happen? 5) Oh, I see. 6 )How did that ever work?

    All programs can be optimized, and all programs have bugs; therefore all programs can be optimized to one line that doesn’t work. /Bob Fitch, Blizzard

  2. #22
    Developer
    Join Date
    Aug 2009
    Posts
    2,659

    Default

    I assume that user defined types - typedefs and record names - are not precluded from being variable or function names. By analogy with the built-in types, presumably they should be.
    Originally Posted by Veracity View Post
    I imagine this would create problems, due to ASH's single-pass, top-down parsing style -- for instance, suppose you defined both a record and a function with the same type. Depending on which one is defined first, an error could (but would not always) be thrown. Unless establishing a type with the same name as an existing function/variable also threw an error, the ASH interpreter would need to be changed to take a double-pass approach. At least, I think this is the case, judging from what little I've read of the ASH interpreter.

    That change broke way more scripts than I expected...
    Originally Posted by Winterbay View Post
    Ayup.

  3. #23
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,262

    Default

    That change broke way more scripts than I expected...
    Originally Posted by Winterbay View Post
    Really? So far I only noticed BatBrain getting broken. Which other scripts have suffered? (I'm proud to say that it didn't effect any of mine, of which I know.)
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  4. #24
    Senior Member Winterbay's Avatar
    Join Date
    Feb 2010
    Posts
    5,033

    Default

    Off the top of my head: SmashLib, MyLittleConsumer, Stannius Spaaace script and Harvest
    My scripts:
    Best sushi for Profit
    Winterbay's Helpful Automatic Monsterbasher (WHAM)

    Scripts maintained by me:
    Autobasement
    Smashlib

    A small programmer joke:
    Wife: Honey, please go to the market and buy 1 bottle of milk. If they have eggs, bring 6.
    The man came back with 6 bottles of milk.
    Wife: Why did you buy 6 bottles of milk.
    Man: Because they had eggs...

    The 6 Stages of Debugging: 1 )That can't happen. 2) That shouldn't happen. 3) Hmmm, weird. 4) Why does that happen? 5) Oh, I see. 6 )How did that ever work?

    All programs can be optimized, and all programs have bugs; therefore all programs can be optimized to one line that doesn’t work. /Bob Fitch, Blizzard

  5. #25
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,262

    Default

    Thanks. I have a habit of not promptly reading threads for scripts I do not use. The problem is much more widespread than I had realized.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  6. #26
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,680

    Default

    The Mr Edge Item functions script, as well. Maybe a few more that I've fixed personally.

  7. #27
    Developer
    Join Date
    Aug 2009
    Posts
    2,659

    Default

    Updated first post with a copy of the map-literals patch, in a perhaps futile attempt to re-rail this thread.

  8. #28
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    D.C. suburbs of Virginia, USA
    Posts
    3,720

    Default

    Updated first post with a copy of the map-literals patch, in a perhaps futile attempt to re-rail this thread.
    Originally Posted by heeheehee View Post
    So I confess that I see neither the utility nor the support for the proposed patch, but I am willing to look for both if they appear in the thread.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post
    There are 69 players more powerful than you.
    Originally Posted by Statistics Leaderboards

  9. #29
    Developer
    Join Date
    Aug 2009
    Posts
    2,659

    Default

    Utility is in the ability to do something like calling a function without having to create a variable just for this express purpose, or for initializing a variable with preset values without requiring an external datafile. I see at least as much utility for this feature as, say, typedefs or ArrayLists in the form of plural typed constants (note: I refer to something of the form $ints[1,1,2,3], not $items[]).

    As for support, the only reason most of the prominent scripters have posted in this thread is because of the bug that this patch uncovered (does this count as secondary utility?). None of them commented initially, which is why I didn't actually start looking into implementing this until a few weeks after the first post.

  10. #30
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,419

    Default

    As an example to illustrate heeheehee's first point:

    PHP Code:
    import <zlib.ash>
    kmail("Zarqon""Here is 10 meat and some bat crap!"10int[item] { $item[bat guano] : } ); 
    (or whatever the syntax will look like)

    Oooh, handy. This as opposed to:

    PHP Code:
    import <zlib.ash>
    int[itemtemporaryitemlist;
    temporaryitemlist[$item[bat guano]] = 3;
    kmail("Zarqon""Here is 10 meat and some bat crap!"10temporaryitemlist); 
    To my memory at least, this is not the first thread to discuss the possibility of ASH constructors for maps.
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

Similar Threads

  1. flyeredML - potential rounding problem
    By Magus_Prime in forum Scripting Discussion
    Replies: 40
    Last Post: 02-17-2015, 12:38 PM
  2. Map literals
    By shademaster00 in forum Scripting Discussion
    Replies: 4
    Last Post: 02-12-2012, 04:43 PM
  3. 10018: Tweak ScriptMRUList for potential reuse.
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 11-21-2011, 04:40 PM
  4. set_auto_attack() – Potential bug?
    By Banana Lord in forum Community Support
    Replies: 4
    Last Post: 06-14-2011, 05:51 AM
  5. Feature Potential Earnings (actual)
    By NardoLoopa in forum Bug Reports
    Replies: 9
    Last Post: 09-07-2010, 07:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •