Re: [q-lang-users] Just starting with Q
Brought to you by:
agraef
From: Burton S. <kr...@gm...> - 2006-08-23 22:55:33
|
I don't have too much time but here's a quick session using my current Q version, right from cvs (my comments start with a #): As can be seen, it works with no prelude, but now it just seems to hang without the prelude. This version of Q was pulled from CVS and built last night. Hopefully this might be of help. Oh, and I'm on a Pentium 4 running Gentoo with no wacky CFLAGS other than the -O2 -g defaults. This seems to be a strange problem, but I don't have any time right now to look more...I shall later. Hope this helps a bit. <9> [~] .Wed Aug 23 16:46:05. cd .q <9> [~/.q] .Wed Aug 23 16:46:08. cat cat cat F:String = cat_file (fopen F "r"); cat F:File = cat_file F; cat F = cat_file (fopen (str F) "r") if issym F; = prints "cat: unsupported type"; cat_file F:File = () if feof F; = putc (fgetc F) || cat F otherwise; cat2 F = () if feof F; = writes (freads F) || writes "\n" || cat F otherwise; <9> [~/.q] .Wed Aug 23 16:48:12. q cat -d -c 'cat (fopen "cat" "r")' ** clib::sys_vars ==> (1,2,4,...) -- def (SIZEOF_CHAR,SIZEOF_SHORT,SIZEOF_INT,...) = (1,2,4,...) -- def SIG_IGN = -1 -- def SIG_DFL = 0 -- def SIG_TRP = 1 -- def SCHED_OTHER = 0 -- def SCHED_RR = 1 -- def SCHED_FIFO = 2 -- def AF_UNIX = 1 -- def AF_FILE = 1 -- def S_ISUID = 2048 -- def S_ISGID = 1024 -- def S_ISVTX = 512 -- def S_IRWXU = 448 -- def S_IRUSR = 256 -- def S_IWUSR = 128 -- def S_IXUSR = 64 -- def S_IRWXG = 56 -- def S_IRGRP = 32 -- def S_IWGRP = 16 -- def S_IXGRP = 8 -- def S_IRWXO = 7 -- def S_IROTH = 4 -- def S_IWOTH = 2 -- def S_IXOTH = 1 ** this_thread ==> <<Thread>> -- def clib::MAIN_THREAD = <<Thread>> ** 1e+307*1e+307 ==> inf -- def inf = inf ** inf-inf ==> nan -- def nan = nan -- def i = complex 0 1 -- def NOARG = 0 -- def REQARG = 1 -- def OPTARG = 2 ** fopen "cat" "r" ==> <<File>> 0> cat, line 2: cat <<File>> ==> cat_file <<File>> cat F:String = cat_file (fopen F "r"); cat F:File = cat_file F; cat F = cat_file (fopen (str F) "r") if issym F; = prints "cat: unsupported type"; cat_file F:File = () if feof F; = putc (fgetc F) || cat F otherwise; cat2 F = () if feof F; = writes (freads F) || writes "\n" || cat F otherwise; () <9> [~/.q] .Wed Aug 23 16:49:02. q cat --no-prelude -d -c 'cat (fopen "cat" "r")' ** fopen "cat" "r" ==> <<File>> 0> cat, line 2: cat <<File>> ==> cat_file <<File>> (type ? for help) : c C-c C-c! Break >>> cat (fopen "cat" "r") ^ # just hangs here, and I have to hit ctl-c <9> [~/.q] .Wed Aug 23 16:50:18. q cat --no-prelude -d -c 'cat2 (fopen "cat" "r")' ** fopen "cat" "r" ==> <<File>> 0> cat, line 8: cat2 <<File>> ==> () if feof <<File>> (type ? for help) : c cat F:String = cat_file (fopen F "r"); C-c C-c! Break >>> cat2 (fopen "cat" "r") ^ # hangs here too |