Page 2 of 3

Re: This is not sparta..? I am lost ;_;

Posted: Sat Aug 01, 2009 9:33 am
by Raider
--I'm with Raider on this on this one. I use both Py-- BrainFuck and Lua, and love them both.

You use the BF interpreter implemented in Python?

--Although the "none-existant = nil" thing was something I liked at first, later on it just annoys me, because Lua won't complain if I misspell anything other than an indexed table or called function.

Woa, good point. I'd better remember that.

--BTW, about the obey thing: Have you read this thread? Any questions about motivation are better directed at rude ;).

Aye, I'd seen that. Merely wondering what it was about, =P

Compliance will ensue should I get an avatar!

Re: This is not sparta..? I am lost ;_;

Posted: Sat Aug 01, 2009 9:51 am
by Robin
Raider wrote:You use the BF interpreter implemented in Python?
Haha, no. It was an inside joke (perhaps this was not the best place for it :monocle:). You see, because mentioning Python here makes people jokingly cry "heretic!", I started using BrainFuck as a euphemism for Python.

Re: This is not sparta..? I am lost ;_;

Posted: Wed Aug 05, 2009 4:51 am
by bartbes
people? only one personality here

on-topic:
one of the most annoying things is that you cant copy a table
and though debbugging nils is not easy but it provides some new ways to handle stuff

Re: This is not sparta..? I am lost ;_;

Posted: Wed Aug 05, 2009 6:09 pm
by Robin
bartbes wrote:people? only one personality here
I was using people as a euphemism for you. I don't know if you know this, but people are afraid of mentioning you. (And by people, I mean me. :emo:)
bartbes wrote:one of the most annoying things is that you cant copy a table
and though debbugging nils is not easy but it provides some new ways to handle stuff
True, true and true. It's also a shame that you can't just print() tables.

Re: This is not sparta..? I am lost ;_;

Posted: Wed Aug 05, 2009 8:00 pm
by bmelts
Robin wrote:It's also a shame that you can't just print() tables.

Code: Select all

function printtable(t)
  for k,v in pairs(t) do
     print(tostring(k)..": "..tostring(v))
  end
end
There's your basic printtable function.

We can also get more complicated and implement recursion through tables inside tables...

Code: Select all

function printtable(t, i)
  if not i then i = 0 end
  local indent = string.rep("\t", i)
  for k,v in pairs(t) do
    if type(v) == "table" then
      print(indent..tostring(k).." (table): ")
      printtable(v, i+1)
    else
      print(indent..tostring(k)..": "..tostring(v))
    end
  end
end
Then it's just a question of:

Code: Select all

oldprint = print
function print(...)
  local a = {...}
  if #a == 1 and type(a[1]) == "table" then -- only printtable if there's one argument (and it's a table)
    printtable(a1)
  else
    oldprint(...)
  end
end
This will print things in the standard fashion if there's more than one argument, or the one argument isn't a table. Only if you call print with one argument, that is a table, will it do printtable. (The reason for this is because trying to reconcile printtable with print's standard formatting is an exercise in tearing your hair out :cry: )

Re: This is not sparta..? I am lost ;_;

Posted: Thu Aug 06, 2009 5:28 pm
by Robin
anjo wrote:There's your basic printtable function.

We can also get more complicated and implement recursion through tables inside tables...
<snip />
Only if you call print with one argument, that is a table, will it do printtable. (The reason for this is because trying to reconcile printtable with print's standard formatting is an exercise in tearing your hair out :cry:)
See? That's what I mean. It's horrible. Horrible, I say!

Other than that, Lua's nice. But for most things that don't involve LÖVE, I prefer BrainFuck (if you know what I mean ;))

Re: This is not sparta..? I am lost ;_;

Posted: Fri Aug 07, 2009 2:33 pm
by Raider
:x

Threads are not transformers which become vehicles for discussion about Python vs Lua.

(Even if it IS balanced and both parties are making perfectly calm, logical points about the advantages and disadvantages.)

Re: This is not sparta..? I am lost ;_;

Posted: Fri Aug 07, 2009 4:07 pm
by Robin
Raider wrote:Threads are not transformers which become vehicles for discussion about Python vs Lua.
They are in the LÖVE CLUB. Here, on-topic posts are rare collectors items (especially in good threads :P).

Re: This is not sparta..? I am lost ;_;

Posted: Fri Aug 07, 2009 6:07 pm
by Pliskin09
I did well in my english essay today.

Re: This is not sparta..? I am lost ;_;

Posted: Fri Aug 07, 2009 7:41 pm
by TechnoCat
I just let my cat inside.