q-lang-users Mailing List for Q - Equational Programming Language (Page 60)
Brought to you by:
agraef
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
(27) |
Mar
|
Apr
(4) |
May
(11) |
Jun
(5) |
Jul
(5) |
Aug
(6) |
Sep
(15) |
Oct
(28) |
Nov
(8) |
Dec
|
2005 |
Jan
(9) |
Feb
(5) |
Mar
(10) |
Apr
(43) |
May
(8) |
Jun
(31) |
Jul
(45) |
Aug
(17) |
Sep
(8) |
Oct
(30) |
Nov
(2) |
Dec
(6) |
2006 |
Jan
(4) |
Feb
(20) |
Mar
(1) |
Apr
|
May
(92) |
Jun
(179) |
Jul
(26) |
Aug
(65) |
Sep
(36) |
Oct
(38) |
Nov
(44) |
Dec
(68) |
2007 |
Jan
(11) |
Feb
(25) |
Mar
(37) |
Apr
(7) |
May
(83) |
Jun
(77) |
Jul
(44) |
Aug
(4) |
Sep
(28) |
Oct
(53) |
Nov
(12) |
Dec
(21) |
2008 |
Jan
(66) |
Feb
(45) |
Mar
(30) |
Apr
(50) |
May
(9) |
Jun
(18) |
Jul
(11) |
Aug
(6) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: <Dr....@t-...> - 2004-04-23 19:04:35
|
Keith Trenton wrote: > Albert -- Happy Birthday! Thanks. :) -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: Keith T. <kaz...@ea...> - 2004-04-23 11:26:42
|
Albert -- Happy Birthday! kazemori |
From: <Dr....@t-...> - 2004-04-23 11:15:38
|
Well, it's St. George's day again -- my birthday. ;-) Instead of chocolates, you get some new RPMs in the deps section at http://sourceforge.net/projects/q-lang/. I've updated the libgii/libggi packages to the latest stable release and also added a SuSE 9.0 midishare package for the Pentium kernel. Cheers, Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Dr....@t-...> - 2004-04-17 23:09:01
|
Hi, well, it's been a little silent around Q the past few weeks, as I've been busy with other things. But, as you might have noticed, new releases of Q and Q-Midi are available now (mostly bugfixes). See http://sourceforge.net/projects/q-lang/ For those of you interested in computer music, you might also wish to take a look at the new Q-Synth package which is available in CVS now (a file release will probably be available in the course of the next few weeks). It currently comprises an interface to OSC ("Open Sound Control", a standard protocol for controlling software synths and other multimedia programs, developed by CNMAT), as well as an interface to SuperCollider3, James McCartney's famous synthesis engine. Currently this has only been tested on Linux; some examples are included. You can browse the CVS module q-synth at: http://cvs.sourceforge.net/viewcvs.py/q-lang/q-synth/ Cheers, Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Dr....@t-...> - 2004-02-29 05:46:50
|
I've just released Q version 5.2. This is a minor update with some bug fixes and optimizations. As a bonus, you also get two new looping constructs (dowhile, for) in the standard library. Enjoy! :) -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <do...@ya...> - 2004-02-26 09:18:56
|
--- Albert Graef <Dr....@t-...> wrote: > Following > up to my earlier mail... > But you also asked for an imperative solution. [...] > ... Wow! Thanks to Albert and Julian. Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com |
From: <Dr....@t-...> - 2004-02-25 11:35:32
|
Following up to my earlier mail... > But you also asked for an imperative solution. [...] There also is a "real" imperative solution, with variable updates and all that nasty stuff, using Q's expression references (a.k.a. mutable values, cf. 12.13 in the manual). Here goes: // additional control constructs special when ~P X, loop P X; when P X = X if P; = () otherwise; loop P X = X || loop P X if P; = () otherwise; // split data lines into (NAME,VAL) pairs parse S = (NAME,VAL) where (NAME,VAL) = sscanf S "%s %d"; // good value = (NAME,VAL) where (NAME,VAL) = sscanf S "%s %s"; // bad value = (NAME,"") where NAME:String = sscanf S "%s"; // missing value = () otherwise; // empty line // the analysis program, imperative style baz = loop (not feof F) (put LINENO (get LINENO+1) || match (parse (freads F)) (case () (), // skip empty lines case (NAME,VAL) (ifelse (isint VAL) // update statistics (when (eq () (get MIN_VAL) or else (get MIN_VAL>VAL)) (put MIN_VAL VAL || put MIN_NAME NAME) || when (eq () (get MAX_VAL) or else (get MAX_VAL<VAL)) (put MAX_VAL VAL || put MAX_NAME NAME) || put SUM (get SUM+VAL) || put COUNT (get COUNT+1)) // report bad value (fprintf ERROR "bad value '%s' at line %d\n" (VAL,get LINENO)) ))) || // report results ifelse (get COUNT>0) (printf "min score == %d (%s)\nmax score == %d (%s)\n" (get MIN_VAL,get MIN_NAME,get MAX_VAL,get MAX_NAME) || printf "avg score == %g\n" (get SUM/get COUNT)) (fwrites ERROR "no data\n") where F:File = fopen "data.txt" "r", LINENO = ref 0, SUM = ref 0, COUNT = ref 0, MIN_NAME = ref (), MIN_VAL = ref (), MAX_NAME = ref (), MAX_VAL = ref (); Plain ugly, but as you can see it's possible. ;-) By adding some more control structures, one could easily embed a complete imperative sublanguage in Q, very much like those found in ML and Haskell (without the syntactic sugar). But I see no real point in doing so. Mutable values can occasionally be useful to speed things up, though. (Note that these aren't even in the core language, rather they are provided by the clib module.) Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Dr....@t-...> - 2004-02-24 02:59:41
|
Hi, Dorothy, and welcome to this list. :) s swami wrote: > Lets say I have a file containing 2 columns like this: > > john 12 > mary 56 > peter ab > vincent 24 > lisa 34 > . > . > . > etc. > > I would like to read the file and output something > like: > > min score == 12 (John) > max score == 56 (Mary) > avg score == 31.5 > > Illegal values: > ab in column 2 on line 3. First, with this simple input format, I'd say that you could simply use sscanf to do the parsing. E.g.: parse S = (NAME,VAL) where (NAME,VAL) = sscanf S "%s %d"; // good value = (NAME,VAL) where (NAME,VAL) = sscanf S "%s %s"; // bad value = (NAME,"") where NAME:String = sscanf S "%s"; // missing value = () otherwise; // empty line This will return a data line (given as a string S) in the form of a pair (NAME,VAL) with VAL an integer if possible. Empty lines will be returned as an empty tuple. Now it is easy to check for the "good" data: good (_,VAL) = isint VAL; With that out of the way, a straightforward solution employing the usual list voodoo would be: foo = report MIN MAX SUM (#GOOD) || writes "\nIllegal values:\n" || do (fprintf ERROR "bad value '%s' at line %d\n") BAD where // get the contents of the data file as a list of strings DATA = split "\n" (fget (fopen "data.txt" "r")), // parse the data, add line numbers in front of each tuple DATA = zipwith push (map parse DATA) [1..#DATA], // get rid of empty lines DATA = filter (compose (neq ()) pop) DATA, // filter the good lines, keep only the data GOOD = filter good (map pop DATA), // filter the bad lines, keep only value and line number BAD = filter (compose (neg good) pop) DATA, BAD = zip (map (!2) BAD) (map (!0) BAD), // compute statistics on the good lines MIN = foldl update_min () GOOD, MAX = foldl update_max () GOOD, SUM = sum (map (!1) GOOD); (If you're running a Q version < 5.1, replace the [1..#DATA] with (nums 1 (#DATA)) above.) Here, I use the following helper functions to collect the min and max statistics: update_min () DATA = DATA; update_min (NAME,VAL) (NAME1,VAL1) = (NAME,VAL) if VAL1>=VAL; = (NAME1,VAL1) otherwise; update_max () DATA = DATA; update_max (NAME,VAL) (NAME1,VAL1) = (NAME,VAL) if VAL1<=VAL; = (NAME1,VAL1) otherwise; Finally, here's a routine to report the results: report _ _ _ 0 = fwrites ERROR "no data\n"; report (MIN_NAME,MIN_VAL) (MAX_NAME,MAX_VAL) SUM COUNT = printf "min score == %d (%s)\nmax score == %d (%s)\n" (MIN_VAL,MIN_NAME,MAX_VAL,MAX_NAME) || printf "avg score == %g\n" (SUM/COUNT); I actually ran this on your input, and it seems to work. :) I get the following output: ==> foo min score == 12 (john) max score == 56 (mary) avg score == 31.5 Illegal values: bad value 'ab' at line 3 But you also asked for an imperative solution. Here's a fully tail-recursive implementation which does the same job, but only reads one line at at time (this one prints out any error messages in advance, fixing that is left as an exercise ;-). It uses the same helper functions from above. bar = process F 1 () () 0 0 where F:File = fopen "data.txt" "r"; process F I MIN MAX SUM COUNT = report MIN MAX SUM COUNT if feof F; = update F I MIN MAX SUM COUNT (parse (freads F)) otherwise; // skip empty lines update F I MIN MAX SUM COUNT () = process F (I+1) MIN MAX SUM COUNT; // collect statistics on good lines update F I MIN MAX SUM COUNT DATA = process F (I+1) (update_min MIN DATA) (update_max MAX DATA) (SUM+VAL) (COUNT+1) where (_,VAL) = DATA if good DATA; // report bad values = fprintf ERROR "bad value '%s' at line %d\n" (VAL,I) || process F (I+1) MIN MAX SUM COUNT where (_,VAL) = DATA otherwise; This just mimics an imperative procedure with local state variables for the current line number and the statistics info, executing a loop until feof F becomes true. Note that the Q interpreter automatically optimizes tail recursion, so the loop is in fact executed in constant stack space. Hope this helps, Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <mip...@ya...> - 2004-02-22 23:29:13
|
--- s swami <do...@ya...> wrote: > Lets say I have a file containing 2 columns like > this: > > john 12 > mary 56 > peter ab > vincent 24 > lisa 34 > ... > etc. > > I would like to read the file and output something like: > > min score == 12 (John) > max score == 56 (Mary) > avg score == 31.5 > > Illegal values: > ab in column 2 on line 3. > > How would I do this in Q? I would especially like to > see an imperative solution if it exists. I have one solution. reviewf Path = review (split "\n" S) where S:String = fget (fopen Path "r"); // replace 'out of band' values to something appropriate -- or maybe // just write a 'firstdata' review Lines = nextdata (Min,Max,Avg,Bad) Lines 1 where Min = (99999,""), Max = (-99999,""), Avg = (0.0,0), Bad = ""; nextdata (Min,Max,Avg,Bad) [] _ = printf "%s\n%s\n%s\n%s\n" (N,X,V,B) where N = sprintf "min score == %d (%s)" Min, X = sprintf "max score == %d (%s)" Max, V = sprintf "avg score == %.1f (from %d)" Avg, B = "\nIllegal values:\n" ++ Bad; nextdata (Min,Max,Avg,Bad) [L|Ls] Ln = nextdata (N,X,V,B) Ls (Ln + 1) where D = split_data L, N = nextmin Min D, X = nextmax Max D, V = nextavg Avg D, B = nextbad Bad D Ln; nextmin (N1,_) [S2,N2:Int] = (N2,S2) if N1 > N2; nextmin Min _ = Min; nextmax (N1,_) [S2,N2:Int] = (N2,S2) if N1 < N2; nextmax Max _ = Max; nextavg (V,N) [_,X:Int] = ((V*N+X)/N2,N2) where N2 = N + 1; nextavg Avg _ = Avg otherwise; nextbad B [_,N:Int] L = B; nextbad B [S,number N] L = sprintf "%s%s on line %d\n" (B,N,L); nextbad B [_,malformed S] L = sprintf "%smalformed line on line %d: %s\n" (B,L,S); split_data S:String = [Name, number Data] // 'number' can fail: see 'nextbad' where [Name, Data] = filter not_empty (split " \t" S); split_data S:String = ["", `malformed S]; number S = val S if alldigits S; alldigits S = true if [true] = regex "" "^[0-9]+$" S true; = false otherwise; not_empty "" = false; not_empty X = true; ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html |
From: <do...@ya...> - 2004-02-22 10:57:07
|
Hi Q experts (and thank you Dr Graf for your creation) I'm trying to learn Q. I know some Haskell and C,etc. I realise that the following is the kind of problem that imperative languages are better suited to, but one can learn a lot from seeing how these icky cases are dealt with in non-imperative languages (and the inverse). ----------------------------------------------------- Lets say I have a file containing 2 columns like this: john 12 mary 56 peter ab vincent 24 lisa 34 . . . etc. I would like to read the file and output something like: min score == 12 (John) max score == 56 (Mary) avg score == 31.5 Illegal values: ab in column 2 on line 3. How would I do this in Q? I would especially like to see an imperative solution if it exists. ----------------------------------------------------- I thank you in advance for your assistance. Dorothy K. Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com |
From: <Dr....@t-...> - 2004-02-20 19:09:48
|
Hi, Q 5.1 has just been released. Official announcements and an update of the homepage will follow soon. Release 5.1 brings an overhaul of the virtual Q machine, which is now fully tail-recursive (as suggested by Walt -- Walt: please check that I wrote your surname right in the ChangeLog, where I gave you credit), a new `enum' builtin along with the usual syntactic sugar for enumerations (the [X..Y] kind of stuff you know from Haskell), a new `qcwrap' utility for creating C wrappers from Q scripts (so you can now turn your Q scripts into self-contained binaries), and a couple of bug fixes (most notably, lambda finally checks that the pattern is linear) and improvements in the build system. You can download Q 5.1 here: (As usual, give it some time until it hits the mirrors.) http://sourceforge.net/project/showfiles.php?group_id=96881&package_id=103965&release_id=218460 The release notes are available here: http://sourceforge.net/project/shownotes.php?group_id=96881&release_id=218460 Enjoy! -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Dr....@t-...> - 2004-02-20 14:58:51
|
ww wrote: > Thank you! What a nice surprise. I'll try the new version this > weekend. Wait a few hours more, then Q 5.1 will be out, and you don't have to build it from cvs yourself. :) -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: ww <wwa...@ea...> - 2004-02-20 04:26:47
|
----- Original Message ----- From: "Albert Graef" <Dr....@t-...> To: <q-l...@li...> Cc: <wwa...@ea...> Sent: Sunday, February 15, 2004 4:10 PM Subject: Re: [q-lang-users] "and then" and stack usage > /me wrote: > > ww wrote: > > > >> I've been exploring Q recently and I've noticed that "and then" doesn't > >> seem to run in constant space. From it's definition (in the docs), I was > >> expecting that it could reuse the stack frame but that doesn't seem to > >> be the case. Am I missing something? > > > > I thought about this problem a little more -- it's really been haunting > > me. ;-) So here's the result of my contemplations... > > > > [snipped] > > I thought about it still some more, and finally decided that this is > really a bug that needs to be solved. Said and done. ;-) So in cvs you > can now find a new version of the interpreter that is fully > tail-recursive. That is, tail calls are now optimized for builtins and > special arguments just as for user-defined rules. Thus, e.g., (=) and > `all' on lists now run in constant stack space, without the need to > rewrite anything. Enjoy! :) > > Albert > > -- > Dr. Albert Gr"af > Email: Dr....@t-..., ag...@mu... > WWW: http://www.musikwissenschaft.uni-mainz.de/~ag Thank you! What a nice surprise. I'll try the new version this weekend. Walt |
From: <Dr....@t-...> - 2004-02-15 21:15:03
|
/me wrote: > ww wrote: > >> I've been exploring Q recently and I've noticed that "and then" doesn't >> seem to run in constant space. From it's definition (in the docs), I was >> expecting that it could reuse the stack frame but that doesn't seem to >> be the case. Am I missing something? > > I thought about this problem a little more -- it's really been haunting > me. ;-) So here's the result of my contemplations... > > [snipped] I thought about it still some more, and finally decided that this is really a bug that needs to be solved. Said and done. ;-) So in cvs you can now find a new version of the interpreter that is fully tail-recursive. That is, tail calls are now optimized for builtins and special arguments just as for user-defined rules. Thus, e.g., (=) and `all' on lists now run in constant stack space, without the need to rewrite anything. Enjoy! :) Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Dr....@t-...> - 2004-02-13 19:25:52
|
ww wrote: > I've been exploring Q recently and I've noticed that "and then" doesn't > seem to run in constant space. From it's definition (in the docs), I was > expecting that it could reuse the stack frame but that doesn't seem to be > the case. Am I missing something? Hi, Walt, I thought about this problem a little more -- it's really been haunting me. ;-) So here's the result of my contemplations... The Q docs say that a definition is tail-recursive only if the recursive call is the last (i.e., outermost) call on the right-hand side of a rule. (If the rhs is an expression sequence X1||...||Xn then the same criterion is applied to the last member of the sequence.) This criterion is a bit more stringent than what you find, e.g., in Scheme. In particular, if the rhs takes the form X and then Y, then Y does *not* qualify as a tail call, since the application of (and then) is the outermost call. If we take this definition for granted, then the problem is actually with the definition of (=) on lists from the prelude, which is *not* tail-recursive. That will have to be fixed (along with some other, similar definitions, like the definition of `all' and `any' in stdlib.q). Here's another example which shows the problem and the possible solution; both foo and bar implement an operation like `all' which verifies that all list members satisfy the given predicate P): def L1 = nums 1 10, L2 = nums 1 100; foo P [X|Xs] = P X and then foo P Xs; foo P [] = true; bar P [X|Xs] = bar P Xs if P X; = false otherwise; bar P [] = true; ==> foo (>0) L1; stats; foo (>0) L2; stats true 0 secs, 41 reductions, 43 cells true 0 secs, 401 reductions, 403 cells ==> bar (>0) L1; stats; bar (>0) L2; stats true 0 secs, 31 reductions, 6 cells true 0 secs, 301 reductions, 6 cells Obviously, the second definition is executed in a tail-recursive fashion while the first one is not; this can also be seen explicitly when running both functions with the debugger: ==> foo (>0) L1 0> tailcall.q, line 4: foo (>0) [1,2,3,...] ==> (>0) 1 and then foo (>0) [2,3,4,...] (type ? for help) : ** 1>0 ==> true ** (>0) 1 ==> true 1> tailcall.q, line 4: foo (>0) [2,3,4,...] ==> (>0) 2 and then foo (>0) [3,4,5,...] : ... ==> bar (>0) L1 0> tailcall.q, line 7: bar (>0) [1,2,3,...] ==> bar (>0) [2,3,4,...] if (>0) 1 : ** 1>0 ==> true ** (>0) 1 ==> true 0> tailcall.q, line 7: bar (>0) [1,2,3,...] ==> bar (>0) [2,3,4,...] : ++ bar (>0) [1,2,3,...] ==> bar (>0) [2,3,4,...] 0> tailcall.q, line 7: bar (>0) [2,3,4,...] ==> bar (>0) [3,4,5,...] if (>0) 2 : ... Of course, one could argue that Q's notion of tail-recursive definitions is a bit too restricted there. The question arises whenever a special form reduces to nothing but one of its special arguments. In this case the interpreter could actually carry out the reduction *before* evaluating the special argument; currently it's the other way round, following the general rule that a special argument is evaluated as soon as its value is required. For various technical reasons, I'd rather like it to stay that way, but I'm open to suggestions there. Any comments? Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Dr....@t-...> - 2004-02-13 02:33:43
|
> Yve...@sp... wrote: > >> I have verified the PATH and the System Variables with the string Qpad >> inside. They are all making a wrong reference to C:\Program Files\Qpad >> instead of the directory of D: in which I have installed Qpad. After a >> correction by hand, Qpad seems to work (I am not yet an expert in Q ...). >> May be the Qpad install script knows only C: > > Oops, that's obviously a bug in the msi. I'll have to check whether I > can change this with the freeware msi builder I'm using. Ok, I've fixed that and uploaded a new Qpad-5.0.zip with the corrected msi to SourceForge (as usual, give it some time until it hits the mirrors). -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Dr....@t-...> - 2004-02-12 20:40:53
|
Yve...@sp... wrote: > I have verified the PATH and the System Variables with the string Qpad > inside. They are all making a wrong reference to C:\Program Files\Qpad > instead of the directory of D: in which I have installed Qpad. After a > correction by hand, Qpad seems to work (I am not yet an expert in Q ...). > May be the Qpad install script knows only C: Oops, that's obviously a bug in the msi. I'll have to check whether I can change this with the freeware msi builder I'm using. -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Yve...@sp...> - 2004-02-12 12:54:52
|
Yves.Pocchiola@sp... wrote: > > I have installed Qpad on Windows NT together with the recommended >> VC6RedistSetup package. The Qpad IDE seems to work fine but when I want to > >execute a script, I get the message: q: exec failed -- check installation. > What NT version are you running? Unfortunately, I only have 5.0 (a.k.a. >Win2K) to test here. Maybe the path isn't initialized properly? What >does the path command in a command window tell you? Can you run q from <the command line? >Albert NT version is 4.00.1381 I have verified the PATH and the System Variables with the string Qpad inside. They are all making a wrong reference to C:\Program Files\Qpad instead of the directory of D: in which I have installed Qpad. After a correction by hand, Qpad seems to work (I am not yet an expert in Q ...). May be the Qpad install script knows only C: Thank you for your help ALCATEL SPACE |
From: <Dr....@t-...> - 2004-02-11 19:19:02
|
Yve...@sp... wrote: > I have installed Qpad on Windows NT together with the recommended > VC6RedistSetup package. The Qpad IDE seems to work fine but when I want to > execute a script, I get the message: q: exec failed -- check installation. What NT version are you running? Unfortunately, I only have 5.0 (a.k.a. Win2K) to test here. Maybe the path isn't initialized properly? What does the path command in a command window tell you? Can you run q from the command line? Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Yve...@sp...> - 2004-02-11 10:08:41
|
I have installed Qpad on Windows NT together with the recommended VC6RedistSetup package. The Qpad IDE seems to work fine but when I want to execute a script, I get the message: q: exec failed -- check installation. Do you have an idea where this problem comes from ? |
From: <Dr....@t-...> - 2004-02-09 21:22:06
|
Hi, FYI: I've just uploaded a bunch of new RPMs for Fedora Core 1, SuSE Linux 8.1 and SuSE Linux 9.0 to the SourceForge site. The dependencies section has also been updated accordingly. As usual, please give the mirrors some time to catch up. If you notice any problems with these packages, please let me know. As an aside, I also tested the latest packages on PlanetCCRMA (http://ccrma-www.stanford.edu/planetccrma/software/), CCRMA's multimedia Linux distribution based on RedHat/Fedora, and they seem to work fine. Note that for the Q-Midi module you need to install CCRMA's own version of the MidiShare RPMs; the RPMs I provide in the deps section are for the standard RedHat 9/Fedora Core 1 kernels only. -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Dr....@t-...> - 2004-02-06 12:41:10
|
Hi, you probably noticed that messages sent to the q-lang mailing lists have been delayed for some time now. I didn't get a reply to my own support request yet, but I've seen the following notice about the ML issues from the SourceForge staff on the ggi-develop ML (which had the same problems, as did many other projects): ----------------------------------------------------- This is a canned response addressing a sitewide problem with SF.net. A filesystem issue on our of our list servers has caused a large backlog of mailing list messages to accumulate, sometimes causing reported delays of up to 5 days (although most messages were not impacted significantly). In some cases, you may have received a warning message from another SF.net mail server (either sf-mx1 or sf-mx2) that the message had spent an undue amount of time on the queue while receiving this error from sf-list1: 421 Unexpected failure, please try later We believe that this failure was due to heavy load on our mail servers (and by extenstion, the DNS servers) from the MyDoom/W32.SCO.* virii. This problem was fixed and over time, the backlog has been worked through (as well as the normal mailing list load). We believe that we are caught up at this point, although it's possible that there are a few exceptions. We deeply regret the inconvenience. If you are still seeing delays in mailing list messages posted after 02/05/2004 please let us know by opening a new Support Request. ----------------------------------------------------- Ok, let's hope that this is fixed now... Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <Dr....@t-...> - 2004-02-06 06:25:33
|
Julian Fondren wrote: >>That's *really* strange. Could you please check the >>generated config.h (in the toplevel directory of the >>sources), to see if it defines HAVE_UNISTD_H? > > It does. With more investigation, the compilation > only falls apart when the '#include <unistd.h>' comes > *after* the '#define _XOPEN_SOURCE 500' in > modules/clib/clib.c Well, the _XOPEN_SOURCE is *supposed* to come first, to get some stuff which isn't available in basic POSIX. If you send me a log of the compile errors then maybe I can figure out what's going on there. >>def S = server 5001 >>def C = socket AF_INET SOCK_STREAM 0 >>connect C ("localhost",5001) > > > Huh, this seems to work with my current version. Well, I think it's a local setup problem. Right now I'm upgrading to SuSE 9.0 on this box, I'll see whether that fixes it. I know that I did test accept/listen/connect once, so it ought to work over here, too. >>Can you try whether this works for you? > > It did =) I ended up with a more nicely formatted > version of the following: > [snip] Congrats. :) How about adding some comments to this example and submit it for inclusion in the next Q release? ;-) Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |
From: <mip...@ya...> - 2004-02-05 07:46:16
|
I thought I'd go ahead and share this, because it took some effort and because I find the result very useful =) This code implements a special (immed_input E) which 'evaluates' E in the context of a nonbuffered nonechoing terminal. This makes some simple and not-so-simple terminal programming very easy to do, in my experience. Here I just went for immed_input and key, as familiar from termios-fiddling Scheme programming -- but GHC has (hSetBuffering h None) and (hSetEcho h False) which would work more generally, nicely building to a (getpass Prompt) as well as a 'key'. I'd appreciate any comments anyone has on the style. (also, does a wiki exist for Q that I could post such code to?) // Thanks to 'info libc' and q's example 'getpass.q' ttysane F (ATTR, TRAPS) = tcsetattr (fileno F) TCSANOW ATTR || zipwith trap TRAPS [SIGINT, SIGTSTP]; mutate [_|Xs] 0 M = [M|Xs]; mutate [X|Xs] N M = [X|mutate Xs (N - 1) M]; attr_raw (IF,OF,CF,LF,IS,OS,CC) = (IF,OF,CF,LF2,IS,OS,CC2) where LF2 = LF and not (ICANON or ECHO), CC2 = mutate (mutate CC VMIN 1) VTIME 0; ttyraw F = assert (isatty FD) || (ATTR, TRAPS) where TRAPS = map (trap SIG_IGN) [SIGINT, SIGTSTP], FD = fileno F, ATTR = tcgetattr FD, () = tcsetattr FD TCSAFLUSH (attr_raw ATTR); special immed_input E; immed_input E = Result where F:File = fopen ctermid "r+", (ATTR, TRAPS) = ttyraw F, Result = E, _ = ttysane F (ATTR, TRAPS); key = immed_input readc; ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html |
From: <Dr....@t-...> - 2004-02-03 10:40:39
|
ww wrote: > I've been exploring Q recently and I've noticed that "and then" doesn't > seem to run in constant space. From it's definition (in the docs), I was > expecting that it could reuse the stack frame but that doesn't seem to be > the case. Am I missing something? No, you're right, the compiler doesn't do any tail call optimization with (and then) or (or else) right now. Hmm, that would certainly be useful. This case is a little more involved than (||), I have to think about it ... Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |