Author Topic: Axe Parser  (Read 566361 times)

0 Members and 2 Guests are viewing this topic.

samebull (metagross111)

  • Guest
Re: Axe Parser
« Reply #1860 on: July 05, 2011, 08:22:16 am »
Actually it is listed there in small font. It said lambdas. Which was also mentioned by other posters on this page of this thread. I'm not even sure why you thought it would be necessary to turn off image blocker anyway, you can click through the spoilers and still read what it says without even messing with image blocker.

*edit*: Ok, it gives alternate text with image blocker on... how strange.

I had to zoom in my browser a zillion times to see that word. then I reasoned the pics might have been screenshots or something. allow images, add water and BOOM, instant headaches with half that screen flashing. It wouldn't have been an issue if I hadn't just zoomed in a couple dozen times.

I was warned of this too in my intro topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Parser
« Reply #1861 on: July 05, 2011, 06:12:58 pm »
I don't think it will ever be "Finished".  Its going to stay alive for a long time, the 1.0.0 will just be the largest, most improved, programming-style changing update to date.  If I ever fear the Parser is starting to die due to real life stuff or boredom of working on the same project for so long, I will definitely pass it on to another programmer to continue, I wouldn't leave you guys hanging. :)

Perpetual betas are awesome :D Good luck on 1.0.
« Last Edit: July 05, 2011, 06:14:04 pm by Deep Thought »




Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: Axe Parser
« Reply #1862 on: July 05, 2011, 06:14:48 pm »
Actually it is listed there in small font. It said lambdas. Which was also mentioned by other posters on this page of this thread. I'm not even sure why you thought it would be necessary to turn off image blocker anyway, you can click through the spoilers and still read what it says without even messing with image blocker.

*edit*: Ok, it gives alternate text with image blocker on... how strange.

I had to zoom in my browser a zillion times to see that word. then I reasoned the pics might have been screenshots or something. allow images, add water and BOOM, instant headaches with half that screen flashing. It wouldn't have been an issue if I hadn't just zoomed in a couple dozen times.

I was warned of this too in my intro topic.

Maybe madly flashing smileys aren't the best idea! (I don't really like them much myself...)
There's something about Tuesday...


Pushpins 'n' stuff...


Offline Compynerd255

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +53/-4
  • Betafreak Games
    • View Profile
    • Betafreak Games
Re: Axe Parser
« Reply #1863 on: July 06, 2011, 08:03:29 pm »
Okay, lambdas are freakin' cool! I can't wait to use them in Axe, although I'm trying to think about how I would... I do know that one of my dad's programs uses lambdas to pass drawing routines for different objects into a positioning routine.
The Slime: On Hold, preparing to add dynamic tiles

Axe Eitrix: DONE

Betafreak Games: Fun filled games for XBox and PC. Check it out at http://www.betafreak.com



Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Parser
« Reply #1864 on: July 07, 2011, 08:10:34 am »
More seriously, Ashbad's referring to inline functions, I presume, which probably aren't going to happen.

Quigibo just said they were gonna happen, so I assume they are :P
Ok, let me rephrase that.

Can someone describe in simple(r) english what lambdas are and how they are used?
« Last Edit: July 07, 2011, 08:10:46 am by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Axe Parser
« Reply #1865 on: July 07, 2011, 11:41:26 am »
Lambdas are interesting programming solutions to difficult problems. I've used them in Python before.
In-progress: Graviter (...)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Parser
« Reply #1866 on: July 07, 2011, 11:43:27 am »
I just realized... Lambdas are basically routines you pass around like arguments, right? I actually need that O.O Good luck on it!




Offline GreenFreak

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +16/-1
    • View Profile
Re: Axe Parser
« Reply #1867 on: July 08, 2011, 07:08:49 am »
I don't understand that...  :(
When should I use lambdas?

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Parser
« Reply #1868 on: July 08, 2011, 01:52:00 pm »
If you're making a falldown game, for instance, where every level comes with a special feature (bouncing, antigravity, whatever), you can make each feature a lambda and pass it to the game.




Ashbad

  • Guest
Re: Axe Parser
« Reply #1869 on: July 08, 2011, 02:16:14 pm »
Well, as someone who uses them all the time in programming, I can say they are very useful in many situations.  They can help reduce the number of methods needed to evaluate a certain value.  DeepThought gives a decent example with different features per level, such as if you had two different levels of gravity:

Code: [Select]
@gravity = lambda {|cur_level|(cur_level%5==0)?(1):(2)} / air_density
So that every five levels the lambda would return 2 instead of 1.  In that example you could take out the lambda and still be fine, but there are even bigger needs for it when you need to directly pass values as parameters into complex equations with highly varying outputs or when you go to attach them to variables directly so that a variable's state is defined by input parameters.  Which brings me to ask, quigibo: are you thinking of adding full support for lambdas/procs with variable attachments and inlining functions, or just inlining?

EDIT: hmm, so the case here isn't just that many don't know how to use them, but that they also don't know what they are :P understandable.  In a nutshell:

Lambdas are functions that stand in for single values (though in some cases they can return multiple values, but don't worry about that most languages don't even support it).  They can take passed arguments and can contain code that'll evaluate expressions and return values accordingly.  Very, very useful.  For a decent background, here's the wikipedia link Qwerty pointed me to a long time ago that I found very helpful: http://en.wikipedia.org/wiki/Lambda_calculus
« Last Edit: July 08, 2011, 02:30:28 pm by Ashbad »

Offline GreenFreak

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +16/-1
    • View Profile
Re: Axe Parser
« Reply #1870 on: July 08, 2011, 02:31:34 pm »
ookaaay...
That sounds really useful :)
But I don't understand the code :P
Code: [Select]
@gravity = lambda {|cur_level|(cur_level%5==0)?(1):(2)} / air_density
EDIT: your EDIT helped me to understand it better! thanks ;)
« Last Edit: July 08, 2011, 02:36:51 pm by GreenFreak »

Ashbad

  • Guest
Re: Axe Parser
« Reply #1871 on: July 08, 2011, 02:37:40 pm »
Simpler variant:

Code: [Select]
if cur_level%5 == 0
  Thing = 1
else
  Thing = 2
end
Gravity = Thing / air_density

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Parser
« Reply #1872 on: July 08, 2011, 02:43:17 pm »
Fine!  I'll give an example since people seem to be confused... :)

Map(λ(r12),L1,100)

If you made a function map (which functional programmers should recognize) this would square the first 100 numbers of L1.  You could pass any function there, this example is a function of 1 argument.  But in general, lambda expressions are functions of r1-r6 depending on how many arguments the function is expecting.  Its as if you had made a label in your code "Lbl A:Return r12" and then passed LA (the address of the function) as the argument.  But here you don't need to assign it a label name... sort of like inline data.
« Last Edit: July 08, 2011, 02:43:32 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Ashbad

  • Guest
Re: Axe Parser
« Reply #1873 on: July 08, 2011, 02:47:49 pm »
* Ashbad pays off people who didn't understand since they allowed him to finally see Axe's implementation :)

EDIT: hmm.. Your implementation is similar to haskell's or lisp's implementation, as more of a higher order function rather than a general purpose value stand in or an attached proc that directly manipulates a variable's value upon accessing.  Anyways, cool, this would be very useful to me in many circumstances, and I guess you can't really implement the pythonic/Rubonic version in axe anyways :P it'd be a bit impracticable
« Last Edit: July 08, 2011, 02:57:47 pm by Ashbad »

Offline GreenFreak

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +16/-1
    • View Profile
Re: Axe Parser
« Reply #1874 on: July 08, 2011, 03:12:03 pm »
* Ashbad pays off people who didn't understand since they allowed him to finally see Axe's implementation :)

;D

I hope, you'll explain that in the Axe-documentation, Quigibo
Because I'm still confused a bit^^ ;D
« Last Edit: July 08, 2011, 03:13:07 pm by GreenFreak »