Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Syntax

Name: Anonymous 2012-01-08 13:49

What programming language has the best, cleanest and most beautiful syntax?

Name: Anonymous 2012-01-08 14:06

Cleanest syntax? Probably Lua; it's like Python but without FIOC and __this__ """shit""". Having array indices start at 1 is completely retarded, though. Here's some arbitrary sample code:

local SET = function() end    -- unique key
local MUTATE = function() end -- unique key

-- decorator function for adding methods.
function mutable_helpers(func, mutate)
  mutate(func, function(old_func, ...)
    if select(1, ...) == SET then
      local k = select(2, ...)
      local v = select(3, ...)
      mutate(func, function(old_func, ...)
        if select(1, ...) == k then return v
        else return old_func(...) end
      end)
    else
      return old_func(...)
    end
  end)
  mutate(func, function(old_func, ...)
    if select(1, ...) == MUTATE then
      local new_func = select(2, ...)
      mutate(func, function(old_func, ...)
        return new_func(old_func, ...)
      end)
    else
      return old_func(...)
    end 
  end)
  return func
end

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List