• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Functional Programming Languages

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #21
    Originally posted by AtW View Post
    That's what I call short term planning - no wonder the West is going downhill...
    What are your plans for SKA in 2100?

    Comment


      #22
      Originally posted by TimberWolf View Post
      What are your plans for SKA in 2100?
      An "Imminent News Placeholder" - Shirley!

      Comment


        #23
        Originally posted by AtW View Post
        Whoever named them "functional" is a retard or it's a sick joke - just search for my ranks in Technical, look for XSLT / XPATH keyrods
        Your whining about XSLT was based on your failure to understand how to use it as a declarative language (along with a failure to grasp that XML requires proper nesting of start and end tags).

        JavaScript has been in active use as a functional language since 1996, and is one of the most widely-used languages in the world today, so it's a bit late to be talking about them as the next big thing.

        Comment


          #24
          Originally posted by NickFitz View Post
          JavaScript has been in active use as a functional language
          I don't have problems with JavaScript - it is certainly NOT a functional language of the likes of Lisp/XSLT and thank God for that!

          XSLT (and anything like it) was designed by people either high up in academia or high on drugs, most likely both - you can't fking use "variable" keyword to define a constant that can't change value, it's not a fking variable!

          Comment


            #25
            Originally posted by TimberWolf View Post
            What are your plans for SKA in 2100?
            You will learn about them in the fullness of time.

            Comment


              #26
              Originally posted by AtW View Post
              XSLT (and anything like it) was designed by people either high up in academia or high on drugs, most likely both - you can't fking use "variable" keyword to define a constant that can't change value, it's not a fking variable!
              It's a variable in a mathematical sense. You can change the value of a variable (to be more precise, you can shadow a variable by creating a new binding over a value in the current scope). For example, the following stylesheet:

              Code:
              <?xml version="1.0" encoding="UTF-8"?>
              <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
                  
                  <xsl:output method="text"/>
                  
                  <xsl:variable name="currentValue">No value</xsl:variable>
                  
                  <xsl:template match="values">
                      <xsl:text>Global value of $currentValue is </xsl:text>
                      <xsl:value-of select="$currentValue"/>
                      <xsl:text>
                      </xsl:text>
                      <xsl:apply-templates select="value"/>
                  </xsl:template>
                  
                  <xsl:template match="value">
                      <xsl:variable name="currentValue" select="text()"/>
                      <xsl:text>Current value of $currentValue is </xsl:text>
                      <xsl:value-of select="$currentValue"/>
                      <xsl:text>
                      </xsl:text>
                  </xsl:template>
                  
              </xsl:stylesheet>
              given the following input:

              Code:
              <?xml version="1.0" encoding="UTF-8"?>
              <values>
                  <value>Foo</value>
                  <value>Bar</value>
                  <value>AtW</value>
              </values>
              will produce the following output:

              Code:
              Global value of $currentValue is No value
              Current value of $currentValue is Foo
              Current value of $currentValue is Bar
              Current value of $currentValue is AtW
              As I always say to people who struggle because they attempt to apply imperative programming techniques to declarative languages: work with the grain, not against it. It's a different paradigm. Most of the things you know from the world of imperative languages are specific to that world, and won't help you.

              Some people even think <xsl:for-each> is a looping construct, FFS

              Comment


                #27
                Originally posted by NickFitz View Post
                Some people even think <xsl:for-each> is a looping construct, FFS
                And it isn't?

                All I wanted to do with this tulipy XSLT is to loop through some data and do some aggregations!

                And don't give me that XPath tulip about doing sums in calls - that wasn't working in .NET - the whole thing is a load of tosh!

                Comment


                  #28
                  Originally posted by NickFitz View Post
                  It's a variable in a mathematical sense.


                  I don't a problem with some crackpot PhDs wasting their grants on developing some crackpot ideas - that's fine by me. It's also fine by me to have "programming" language of the kind they developed.

                  What's not ****ing fine is the words they've chosen to describe it, specifically "functional" - I could ****ing do simple tasks with it, just how ****ing functional is that?!?!

                  Those "variables" also named in such a way that I feel the urge to lodge a complaints to Advertising Standards Authority as I feel been grossly mislead!

                  Comment


                    #29
                    But if you want your code to parallelize easily, your going to have to get with the crackpot PhD stuff.
                    Insanity: repeating the same actions, but expecting different results.
                    threadeds website, and here's my blog.

                    Comment


                      #30
                      Originally posted by AtW View Post
                      And it isn't?

                      All I wanted to do with this tulipy XSLT is to loop through some data and do some aggregations!

                      And don't give me that XPath tulip about doing sums in calls - that wasn't working in .NET - the whole thing is a load of tosh!
                      Of course not. Looping allows side effects, and side effects cause bugs.

                      Surely <xsl:value-of select="sum(element/@value)"/> isn't that hard? Look, like this stylesheet:

                      Code:
                      <?xml version="1.0" encoding="UTF-8"?>
                      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
                      
                          <xsl:output method="text"/>
                          
                          <xsl:template match="elements">
                              <xsl:text>Sum of element values is </xsl:text>
                              <xsl:value-of select="sum(element/@value)"/>
                          </xsl:template>
                      
                      </xsl:stylesheet>
                      applied to this input:

                      Code:
                      <?xml version="1.0" encoding="UTF-8"?>
                      <elements>
                          <element value="1"/>
                          <element value="2"/>
                          <element value="3"/>
                          <element value="4"/>
                          <element value="5"/>
                          <element value="6"/>
                      </elements>
                      giving this output:

                      Code:
                      Sum of element values is 21
                      See, it's easy

                      Comment

                      Working...
                      X