bad code, strange error

Started by tomtoo, November 02, 2011, 07:52:47 AM

Previous topic - Next topic

tomtoo

Hey guys,



this



(set 'agz (main-args 2))
(set  'onetwo (parse agz "."))
(if (= (length onetwo) 1)(append onetwo ".org")
(set 'onetwotwo (cons (onetwo 0)(onetwo 1))))


results in this



ERR: invalid function : (PLUG)


Ok, so the code is probably a terrible perversion, but I'm curious about the error.

cormullion

#1
How are you calling this? Without any arguments to the script on the command line, I get:



ERR: string expected in function parse : agz



If there is an argument, it gives either:



ERR: list expected in function append :



or



ERR: invalid list index in function cons



if the string's empty. If the string has a period, it doesn't give an error.



It's all a bit weird... :)

tomtoo

#2
I can't reproduce the error. dang.



Still, up 'til now, I've never typed or seen (PLUG) anywhere, ever.



I worked around the problem, so I never saw it again, but I think it's weird too.