timl icon indicating copy to clipboard operation
timl copied to clipboard

Error when autoloading .tim file: Key not present in Dictionary: chunk_first

Open sjl opened this issue 11 years ago • 5 comments

So after #11 I moved my .tim code into autoload/ and added a .vim stub in plugin/, and now I get the following error when I run the stubbed command (which calls the TimL code):

Error detected while processing function <SNR>72_autoload..timl#loader#source..timl#compiler#build..<SNR>130_emit..timl#call..326..timl#type#apply..timl#lazy_seq#seq..<SNR>132_val..t
iml#call..468..<SNR>107_predicate..timl#coll#chunked_seqp:
line    1:
E716: Key not present in Dictionary: chunk_first)
E116: Invalid arguments for function timl#type#canp(a:coll, g:timl#core.chunk_first)
E15: Invalid expression: timl#type#canp(a:coll, g:timl#core.chunk_first)
Error detected while processing function <SNR>72_autoload:
line   10:
E170: Missing :endfor
Press ENTER or type command to continue

I probably fucked something up, but it'd be nice to have a friendlier error.

sjl avatar Apr 05 '14 16:04 sjl

Also, this .tim file works fine if I put it in a buffer and :source % it, so there's probably some weird autoload ordering issues here.

sjl avatar Apr 05 '14 16:04 sjl

Definitely some sort of load order issue. chunked-seq? can't find chunk-first. Someone else reported the exact same error that went away after clearing their cache.

I don't have time to dig in right now, but you should share your :scriptnames, which might give me some clues later.

tpope avatar Apr 05 '14 16:04 tpope

scriptnames http://paste.stevelosh.com/534036b7dd79590007000000

sjl avatar Apr 05 '14 17:04 sjl

I don't understand why that is missing all the timl autoload files, even the ones in the error message.

tpope avatar Apr 05 '14 17:04 tpope

I noticed if I ran something in a TLrepl before trying to run one of my commands I wouldn't get this error, and I eventually found that if I put:

let code = timl#cons#create(timl#symbol#intern('do'), timl#reader#read_string_all("1"))
call timl#loader#eval(code)

at the top of my foo.vim file everything would run OK. From what I can tell if I remove any of the elements of this it stops fixing the problem. The code is at justinj/vim-relax if that helps you debug at all.

justinj avatar Apr 10 '14 01:04 justinj