### Author Topic: [Tutorial] Edition 2: Using Axe to its full functional form λ  (Read 10693 times)

0 Members and 1 Guest are viewing this topic.

#### Quigibo

• The Executioner
• CoT Emeritus
• LV11 Super Veteran (Next: 3000)
• Posts: 2031
• Rating: +1075/-24
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #15 on: July 19, 2011, 03:30:42 pm »
Unfortunately I can't add an extra space to the token because of ReturnIf.  I don't think adding in a space is messy, and you can ignore the space if you want, its still valid.
___Axe_Parser___
Today the calculator, tomorrow the world!

• Guest
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #16 on: July 19, 2011, 03:31:44 pm »
Good point.  But I prefer the old style better even if it is valid the other way.

#### LincolnB

• Check It Out Now
• LV9 Veteran (Next: 1337)
• Posts: 1115
• Rating: +125/-4
• By Hackers For Hackers
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #17 on: July 19, 2011, 03:41:52 pm »
Quote

Really? I think it's great unless you're trying to indent all of your if statements and loops were there's like thirteen nested layers
Completed Projects:
>> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
>> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.

Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)

• Guest
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #18 on: July 19, 2011, 03:58:41 pm »
Quote

Really? I think it's great unless you're trying to indent all of your if statements and loops were there's like thirteen nested layers

Well, I like to think of it as being a last equation -> outside world notation rather than a give equation notation.  I also like to think of Return as an end for a def statement, since explicit routines are only created with a label with no ending keyword, an adding something past that would make it feel akward.

#### LincolnB

• Check It Out Now
• LV9 Veteran (Next: 1337)
• Posts: 1115
• Rating: +125/-4
• By Hackers For Hackers
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #19 on: July 19, 2011, 04:14:24 pm »
Well, I like to think of it as being a last equation -> outside world notation rather than a give equation notation.

What in the world do you mean?
Completed Projects:
>> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
>> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.

Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)

• Guest
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #20 on: July 19, 2011, 04:20:43 pm »
What I mean is that I think of returning values in Axe in a more functional way, so that the last expression is the overall output value for the entire function.  That way, I only use Return for ending the definition ending.

#### LincolnB

• Check It Out Now
• LV9 Veteran (Next: 1337)
• Posts: 1115
• Rating: +125/-4
• By Hackers For Hackers
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #21 on: July 19, 2011, 04:32:47 pm »
Oh, all right.
Completed Projects:
>> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
>> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.

Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)

#### ztrumpet

• The Rarely Active One
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 5712
• Rating: +364/-4
• If you see this, send me a PM. Just for fun.
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #22 on: July 19, 2011, 04:55:40 pm »
What I mean is that I think of returning values in Axe in a more functional way, so that the last expression is the overall output value for the entire function.  That way, I only use Return for ending the definition ending.
Yeah, I tend to think of it this way as well.
If I'm wrong, please correct me!
Unfinished Projects:
 Elmgon 14% Basic Movement Demo Homescreen Game Pack 80% Basic Latest Release Cube Droid Saves the Galaxy 65% Axe Demo Detonate 70% Axe
Completed Projects:
Exodus | Midnight |Drifter | Axe Snake | Jump! | Factory Theta | Spider | Plot Drop | Papi Jump | Numb3rs | Nibbler | Boost | Duel Tile Map Editor | Homescreen Map Editor | Key Group Check | Oasis

#### nemo

• LV9 Veteran (Next: 1337)
• Posts: 1203
• Rating: +95/-11
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #23 on: July 19, 2011, 07:27:36 pm »
quick question, what's the advantage of currying in axe? as runer pointed out, it takes up more memory, and in my opinion, looks messier

• Guest
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #24 on: July 19, 2011, 07:41:27 pm »
Well, depends on what form of currying you're talking about.  For non-pure-functional currying, its useful because it means in general that you're just passing parameters to explicit or non-explicit functions called or even defined and then called inside of the function.  For Haskellian currying, there is no definite use, unless you want to pass a very, very long list of parameters.

#### selectcoaxial

• LV2 Member (Next: 40)
• Posts: 29
• Rating: +0/-0
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #25 on: July 24, 2011, 07:58:48 am »
beginner question, how do you get r1 and r2 on the graphics calculator?

#### mrmprog

• LV7 Elite (Next: 700)
• Posts: 559
• Rating: +35/-1
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #26 on: July 24, 2011, 08:02:29 am »
Vars->Y-Vars->Polar
Hope that helps.

• Guest
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #27 on: July 24, 2011, 08:37:20 am »
You can have up to 6, using tokens r1-r6.

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #28 on: July 24, 2011, 01:14:13 pm »
A subroutine is called like:

Code: [Select]
sub(DD, A, "HELLO", C, 5)
In this example, A is r1, "HELLO" is r2, C is r3, 5 is r4.

I once needed more arguments...

• Guest
##### Re: [Tutorial] Edition 2: Using Axe to its full functional form λ
« Reply #29 on: July 28, 2011, 09:33:52 pm »
So, is this just going to never be in the new "Tutorials" section?  I've asked like 5 times in 3 separate threads, and I'm pretty much forced to give up all hope.  People who want to see this will have to follow the new "this is outdated link" in the old tutorial, I guess

Edit:

A subroutine is called like:

Code: [Select]
sub(DD, A, "HELLO", C, 5)
In this example, A is r1, "HELLO" is r2, C is r3, 5 is r4.

I once needed more arguments...

On a side note here is a good example of where Haskellian currying would be put to good use.  Let's say you need 8 arguments.  You can always curry so to get some more parameters.

Code: [Select]
(ADD8(1,2,3,4,5,6))(7,8)Lbl ADD8  r1+r2+r3+r4+r5+r6->r6  λ(r6+r1+r2)Return
Trivial example again, but shows essentially what I mean.  While this example contradicts it, I suggest you limit curried functions up to 5 parameters so that r6 can hood intermediate values between function followings.
« Last Edit: July 28, 2011, 09:41:44 pm by Ashbad »