Dia

Test wegen Syntax Highlighting

Recommended Posts

do  -- The marker table serves double duty. It is a private key in the  -- hash, and also serves as the hashes metatable.  local marker = {}  -- If the key is not found, we use the saved function (stored with the  -- private key) to generate a value, and save it.  function marker.__index(t, k)    local val = t[marker](k)    t[k] = val    return val  end  -- We make the table look like a function, just deferring to lookup  function marker.__call(t, k)    return t[k]  end  -- They'll hit an endless loop if they do Memoize(nil). So we do  -- something reasonable. We could also report an error, of course.  function Memoize(fn)    local self = {[marker] = fn or function(x) return nil end}    setmetatable(self, marker)    return self  endend

-- test 2

do

-- The marker table serves double duty. It is a private key in the

-- hash, and also serves as the hashes metatable.

local marker = {}

-- If the key is not found, we use the saved function (stored with the

-- private key) to generate a value, and save it.

function marker.__index(t, k)

local val = t[marker](k)

t[k] = val

return val

end

-- We make the table look like a function, just deferring to lookup

function marker.__call(t, k)

return t[k]

end

-- They'll hit an endless loop if they do Memoize(nil). So we do

-- something reasonable. We could also report an error, of course.

function Memoize(fn)

local self = {[marker] = fn or function(x) return nil end}

setmetatable(self, marker)

return self

end

end

Link to comment
Share on other sites

Like that, Zeilen wären noch nicht schlecht (Zeilennummernrand).

Example:

--blablabla

Das würde bedeuten das er sich links ab der Zeile 67 dann runterarbeitet.

Link to comment
Share on other sites

Like that, Zeilen wären noch nicht schlecht.

Example:

blabblub

Das würde bedeuten das er sich links ab der Zeile 67 dann runterarbeitet.

Muss ich mal schaun obs sowas gibt.

Ging mir erstmal darum dass er LUA Code unterstützt und nicht als C Code behandelt :)

Ja, linenumbers sollten drin sein, sind aber nicht. :) Danke Prettify

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now