Re: [q-lang-users] Just starting with Q
Brought to you by:
agraef
From: Burton S. <kr...@gm...> - 2006-08-22 23:31:10
|
On 8/22/06, Albert Graef <Dr....@t-...> wrote: > The following program, which doesn't depend on clib or anything else in > the standard library works fine with --no-prelude, though: > > cat F = () if feof F; > = writes (freads F) || writes "\n" || cat F otherwise; > > Your code (without the writes "\n") runs fine with --no-prelude, too, > but of course the newlines are missing. > > Could you please check whether the above program works ok for you when > run with --no-prelude? I.e., the output should be something like: > > $ q --no-prelude cat.q > > ==> def F = fopen "cat.q" "r"; cat F > cat F = () if feof F; > = writes (freads F) || writes "\n" || cat F otherwise; > () > I did just check your above code and my own code, and neither of them run when the --no-prelude option is given (both return the "cat <<File>>") but both work fine otherwise. > > This could be interesting to you since the code I wrote doesn' > > actually use any of the prelude functions; maybe there's a bit of code > > in the prelude loading code that sets something up in the interpreter > > that is causing this problem. > > There shouldn't be. The above program should work fine without the > prelude. If it doesn't then there's a bug lurking somewhere, which needs > to be fixed. I'd be surprised if this was so, because these basic > examples have been checked on many systems many times. But, C being what > it is, you can never be sure. ;-) Yes, that is true; bugs always lurk, and I have to admit, I'm really good at finding the obscure ones over the course of my lifetime ;-) Maybe I'll dig a bit into the code and see what I can find in there, and just to have a look around since I always like to know the internals of what I'm working with. For now I'll do my playing around with the prelude enabled, at least until we can get same behaviour from both; learning is hard with obscure bugs getting in the way sometimes. Thanks for your help with this issue. -- burton samograd kr...@gm... kruhft.boldlygoingnowhere.org www.myspace.com/kruhft |