Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. A little F# for you

A little F# for you

Scheduled Pinned Locked Moved The Lounge
csharpphpwpfcomregex
113 Posts 48 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Josh Smith

    John Simmons / outlaw programmer wrote:

    Looks like a bastardization of dBase2 and interpreted basic.

    Something tells me that you won't be an F# "early adopter." :)

    :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

    realJSOPR Offline
    realJSOPR Offline
    realJSOP
    wrote on last edited by
    #47

    If it took me almost 7 years to start coding in .net, you can imagine how excited I am about F#...

    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
    -----
    "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

    R B 2 Replies Last reply
    0
    • J Josh Smith

      Marc Clifton wrote:

      I think we need to explore your childhood, Josh.

      :laugh:  I was raised by a pack of wolves, and ate peyote for breakfast.

      :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

      E Offline
      E Offline
      El Corazon
      wrote on last edited by
      #48

      Josh Smith wrote:

      I was raised by a pack of wolves

      we might be related! ;P

      _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

      1 Reply Last reply
      0
      • J Justin Perez

        Ravel H. Joyce wrote:

        But no, I won't do anything like that. I promise.

        Ok good. Like I said you are a very smart kid, and drugs would only ruin your hopes, dreams, and your desire to be a good, honest person. It will kill your zest for life! You really should remove that Hansen song from your signature though, and stop listenting to that crap. That will also ruin your life!:laugh::laugh::laugh::cool:

        I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")

        S Offline
        S Offline
        soap brain
        wrote on last edited by
        #49

        Justin Perez wrote:

        stop listenting to that crap

        :suss: ... ... ... ...I almost didn't change it, you know...'Mmmbop' is fun! You're killing my zest for life.

        "Who wants waffles? We got a new album out...it's called 10,000 Days. Buy it so I can afford waffles." -Maynard James Keenan

        J T 2 Replies Last reply
        0
        • D Dan Neely

          ph'nglui magl'nath cthulhu r'lyeh wagn'nagl fhtagn

          -- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.

          E Offline
          E Offline
          El Corazon
          wrote on last edited by
          #50

          yes, but the big question is... is He dreaming of F#?

          _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

          D 1 Reply Last reply
          0
          • P Pete OHanlon

            Strangely reminiscent of Lisp as well.

            Deja View - the feeling that you've seen this post before.

            E Offline
            E Offline
            El Corazon
            wrote on last edited by
            #51

            everything old is new again....

            _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

            1 Reply Last reply
            0
            • E El Corazon

              yes, but the big question is... is He dreaming of F#?

              _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

              D Offline
              D Offline
              Dan Neely
              wrote on last edited by
              #52

              nah, malbolge[^]

              -- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.

              E 1 Reply Last reply
              0
              • R Rama Krishna Vavilala

                Not very different than prolog or scheme (my favorite language). Prolog:

                sum([X | Y], Z) :- sum(Y, A), Z is A + X.
                sum([], 0).

                Scheme:

                (define sum (lambda (x)
                (if (null? x) 0 (+ (car x) (sum (cdr x))))))

                Co-Author ASP.NET AJAX in Action

                J Offline
                J Offline
                Judah Gabriel Himango
                wrote on last edited by
                #53

                Scheme and its never ending parens reminds me of this XKCD on Lisp[^]. :)

                Tech, life, family, faith: Give me a visit. I'm currently blogging about: No, Not I - A poem by Holocaust escapee, chief rabbi, and Messiah-follower Daniel Zion The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

                1 Reply Last reply
                0
                • J Josh Smith

                  I've been studying F# a lot recently and find it really mind-bending.  Tomas Petricek, a fellow CPian, let me sneak preview his series of F# articles and they are very good.  I took one of his examples and modified it a bit.  The following code displays "sum = 6", but how that happens is other-worldly...check it out:

                  #light

                  let rec sum nums =
                    match nums with
                    | head::tail -> head + sum(tail)
                    | [] -> 0
                   
                  printf "sum = %i" (sum [1; 2; 3])

                  Weird, eh?   F# is coooool. :cool:

                  :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #54

                  Grown bored with WPF now have you? No challenges left there?

                  Deja View - the feeling that you've seen this post before.

                  J 1 Reply Last reply
                  0
                  • S soap brain

                    Justin Perez wrote:

                    stop listenting to that crap

                    :suss: ... ... ... ...I almost didn't change it, you know...'Mmmbop' is fun! You're killing my zest for life.

                    "Who wants waffles? We got a new album out...it's called 10,000 Days. Buy it so I can afford waffles." -Maynard James Keenan

                    J Offline
                    J Offline
                    Justin Perez
                    wrote on last edited by
                    #55

                    Ravel H. Joyce wrote:

                    ...I almost didn't change it, you know...'Mmmbop' is fun! You're killing my zest for life.

                    Haha sorry man, you can keep it in your sig! :rolleyes:

                    I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")

                    S 1 Reply Last reply
                    0
                    • D Dan Neely

                      nah, malbolge[^]

                      -- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.

                      E Offline
                      E Offline
                      El Corazon
                      wrote on last edited by
                      #56

                      dan neely wrote:

                      nah, malbolge[^]

                      :doh::doh: I had heard of that, but never looked to see what it was.... :doh::doh:

                      _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                      1 Reply Last reply
                      0
                      • P Pete OHanlon

                        Grown bored with WPF now have you? No challenges left there?

                        Deja View - the feeling that you've seen this post before.

                        J Offline
                        J Offline
                        Josh Smith
                        wrote on last edited by
                        #57

                        Pete O'Hanlon wrote:

                        Grown bored with WPF now have you?

                        Argh! Don't say that!!  I, too, feel that I "must remain" pidgeon-holed into WPF.  But I don't want to feel trapped like that.  I am a bit tired of WPF at the moment, considering that I've studied nothing else for the past two years!  Plus, part of my agenda[^] is to see if/how F# and WPF can work together.

                        Pete O'Hanlon wrote:

                        No challenges left there?

                        Yeah right.  I've only scratched the surface.

                        :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                        R E P 3 Replies Last reply
                        0
                        • J Josh Smith

                          I've been studying F# a lot recently and find it really mind-bending.  Tomas Petricek, a fellow CPian, let me sneak preview his series of F# articles and they are very good.  I took one of his examples and modified it a bit.  The following code displays "sum = 6", but how that happens is other-worldly...check it out:

                          #light

                          let rec sum nums =
                            match nums with
                            | head::tail -> head + sum(tail)
                            | [] -> 0
                           
                          printf "sum = %i" (sum [1; 2; 3])

                          Weird, eh?   F# is coooool. :cool:

                          :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                          K Offline
                          K Offline
                          Keith Andersch
                          wrote on last edited by
                          #58

                          Oh...I remember this. In my Programming Languages class when we did ML....*shivers* Right when I saw "head::tail" and the recursive call. I would like to see a whole application written in this, though. - Keith

                          1 Reply Last reply
                          0
                          • J Justin Perez

                            Ravel H. Joyce wrote:

                            ...I almost didn't change it, you know...'Mmmbop' is fun! You're killing my zest for life.

                            Haha sorry man, you can keep it in your sig! :rolleyes:

                            I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")

                            S Offline
                            S Offline
                            soap brain
                            wrote on last edited by
                            #59

                            Nah, I like Maynard. I admire him perhaps more than anybody else. Not that I would ever tell anyone such a thing... :doh:

                            "Who wants waffles? We got a new album out...it's called 10,000 Days. Buy it so I can afford waffles." -Maynard James Keenan

                            1 Reply Last reply
                            0
                            • J Josh Smith

                              Pete O'Hanlon wrote:

                              Grown bored with WPF now have you?

                              Argh! Don't say that!!  I, too, feel that I "must remain" pidgeon-holed into WPF.  But I don't want to feel trapped like that.  I am a bit tired of WPF at the moment, considering that I've studied nothing else for the past two years!  Plus, part of my agenda[^] is to see if/how F# and WPF can work together.

                              Pete O'Hanlon wrote:

                              No challenges left there?

                              Yeah right.  I've only scratched the surface.

                              :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                              R Offline
                              R Offline
                              Rama Krishna Vavilala
                              wrote on last edited by
                              #60

                              Josh Smith wrote:

                              I've only scratched the surface.

                              of WPF or F#?:rolleyes:

                              Co-Author ASP.NET AJAX in Action

                              J 1 Reply Last reply
                              0
                              • J Josh Smith

                                leppie wrote:

                                Wouldnt that just destructure your input list into 'head' and 'tail' variable? Perhaps the '::' has special meaning?

                                Keep in mind, I've only been studying F# for a few days now.  But, my current understanding is that F# uses the x::y syntax for dealing with its "list" type.  You can create a list, or pull one apart, with that :: operator.  AFAIK, writing "head::tail" (or foo::goo) is a way of saying "Give me the first cell in the list, and then also give me the remainder of the list."

                                :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                                L Offline
                                L Offline
                                leppie
                                wrote on last edited by
                                #61

                                Ahh so it similar to to Scheme/Lisp's . operator :)

                                xacc.ide
                                The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

                                1 Reply Last reply
                                0
                                • R Rama Krishna Vavilala

                                  Josh Smith wrote:

                                  I've only scratched the surface.

                                  of WPF or F#?:rolleyes:

                                  Co-Author ASP.NET AJAX in Action

                                  J Offline
                                  J Offline
                                  Josh Smith
                                  wrote on last edited by
                                  #62

                                  Rama Krishna Vavilala wrote:

                                  of WPF or F#?

                                  I meant WPF.  I don't even know where the surface of F# is yet! :)

                                  :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                                  R 1 Reply Last reply
                                  0
                                  • J Josh Smith

                                    Pete O'Hanlon wrote:

                                    Grown bored with WPF now have you?

                                    Argh! Don't say that!!  I, too, feel that I "must remain" pidgeon-holed into WPF.  But I don't want to feel trapped like that.  I am a bit tired of WPF at the moment, considering that I've studied nothing else for the past two years!  Plus, part of my agenda[^] is to see if/how F# and WPF can work together.

                                    Pete O'Hanlon wrote:

                                    No challenges left there?

                                    Yeah right.  I've only scratched the surface.

                                    :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                                    E Offline
                                    E Offline
                                    El Corazon
                                    wrote on last edited by
                                    #63

                                    Josh Smith wrote:

                                    Plus, part of my agenda[^] is to see if/how F# and WPF can work together.

                                    ahhhh... WPF# eh? :-D

                                    _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                                    J 1 Reply Last reply
                                    0
                                    • E El Corazon

                                      Josh Smith wrote:

                                      Plus, part of my agenda[^] is to see if/how F# and WPF can work together.

                                      ahhhh... WPF# eh? :-D

                                      _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                                      J Offline
                                      J Offline
                                      Josh Smith
                                      wrote on last edited by
                                      #64

                                      El Corazon wrote:

                                      WPF# eh?

                                      If I throw in some C++ somewhere, I could be the master of WPF#++

                                      :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                                      E 1 Reply Last reply
                                      0
                                      • D Dan Neely

                                        I know you are but what am I... :laugh:

                                        -- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.

                                        J Offline
                                        J Offline
                                        Josh Smith
                                        wrote on last edited by
                                        #65

                                        dan neely wrote:

                                        I know you are but what am I...

                                        That's what she said! ;P

                                        :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                                        1 Reply Last reply
                                        0
                                        • J Josh Smith

                                          Chris Maunder wrote:

                                          That looks like a huge advancement in clarity and code maintainability.

                                          Hahaha.  Yeah right.  I get the feeling that F# isn't going to become a "mainstream" .NET language anytime soon.  It's out there: far, far out there.  It has virtues different from clarity and code maintainability.  I'm just a newbie so don't quote me, but supposedly using F# as a functional programming language allows you to more easily write code which can be parallelized across multiple processors or cores.  I'm interested to see how to do that, because I think that's an important aspect of modern software design.

                                          :josh: My WPF Blog[^] Without a strive for perfection I would be terribly bored.

                                          M Offline
                                          M Offline
                                          Mike Dimmick
                                          wrote on last edited by
                                          #66

                                          It's for problems where you indicate what you want performed on every member of a list (map) or how you aggregate the contents of a list (reduce). In theory, because each of the operations is atomic (independent of the other items), in the case of the map operation, or the result of reducing the whole list is the same as reducing distinct subparts of the list then reducing the results of those suboperations, you can farm out subparts of the list to other cores to execute in parallel. Because it's implicit, the environment can scale the algorithm appropriately to the number of installed cores. Still, it's not much that a parallel foreach couldn't do. It's just we're not used to writing our programs as such discrete blobs of functionality, effectively putting half your program out-of-line. And I'm not sure that many of the programs we regularly use would benefit - your data set would have to be pretty big to overcome the cost of the inter-thread procedure calling required to get another core working on part of the problem. I'm not totally sure the MHz myth is as over as it seemed a few years ago. The 45nm generation with high-k dielectric looks like it may have solved or at least alleviated the leakage problems that caused such trouble with overheating when trying to ramp up the clock speeds. The Core 2 Duo E8500 is supposed to clock at 3.16GHz while keeping a Thermal Design Power of 65W (source[^]).


                                          DoEvents: Generating unexpected recursion since 1991

                                          J D 2 Replies Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups