... I can read this okay up until the phrase "obviously not in the source code." Then I get completely lost. I'm going to reduce the argument to a logical form...
... That is what I mean. Say you give a macro a quotation. That quotation type checks. Now say the macro tears the quotation apart, and one of the individual...
John Nowak
john@...
May 2, 2008 1:36 am
4041
Before I start: http://citeseer.ist.psu.edu/dornan98typesecure.html seems to possibly have something to do with this (maybe?). It's about using dynamic types...
Still on the topic of quote and eval, it occurred to me that the Unix command languages (sh, csh, ksh, bash,..) have their own eval operator. It is the ...
... You may find this interesting http://rosettacode.org/wiki/Category:UnixPipes (Using unix pipes and files rather than the shell language). ... Rahul...
... I don't know what the lesson would be. Backquotes escape from a string context to an executation/evaluation context. I suppose one could do that in a...
... Backquotes -- as is clearly shown by the alternative syntax $(...) -- essentially belong to the lexical level of the shell, just like $name substitution....
So IIUC applying the idea to a concatenative language like Cat: [is_weekend ["happy'] ["sad"] if] ` apply Will generate different code depending on the day of...
... Maybe I should not have chosen those examples with the chatty strings inside which the backquote occurred. Here is an example that illustrates the Eval = ...
... Thank you, I did not know about the alternative syntax. My relevant manual (in this case Bournešs ..The Unix Programming Environment.. 1982 (?) does not...
... It didn't exist that long ago, but it is in Posix, and therefore in the ash/dash, ksh, and bash shells at least. ... "Lisp programmers don't write in Lisp:...
Hi, Manfred, This discussion triggered a memory which caused me to consult a REXX manual. In REXX ordinary strings enclosed in matching single or double...
I took the 's' and 'k' combinators from here: http://tunes.org/~iepos/joy.html Yes, the definition for 's' could be much better, but I don't know really know...
John Nowak
john@...
May 18, 2008 1:39 am
4052
In some languages, such as Haskell, all functions consume a fixed number of arguments and produce a fixed number of arguments.* For example, the 'foldr'...
John Nowak
john@...
May 20, 2008 6:15 am
4053
This is a reasonable idea for some cases, but there's some generality ... swapd each ; When each runs, it has the stack underneath as an implicit accumulator....
... Certainly. ... Aye. It makes sense as 'each' is a generalized version of 'fold' that allows you to access the stack and not just deal with two values. It's...
John Nowak
john@...
May 20, 2008 7:21 am
4055
Here is a visualization of the function 'swap dup dip swap' where we want the quotation supplied to 'dip' to consume two arguments and produce one (as '+' or...
John Nowak
john@...
May 20, 2008 9:48 am
4056
... Based on the things I've written in Factor a 'fixed arity' restriction would have little to no effect on what I've written. It did in the past when 'curry'...
... "Impossible" is an overly strong word (especially in conjunction with a shades-of-grey word like "efficiently"). It's quite possible to use the stack in...
... Very good to hear! I was half-expecting it to be shot down for being overly restrictive. ... The version using map-with is certainly clearer. Perhaps there...
John Nowak
john@...
May 20, 2008 10:13 pm
4059
... That makes sense. Agreed. ... That's certainly possible. I already have that syntax for special forms anyway. It might be nice to not require the numbers...
John Nowak
john@...
May 20, 2008 10:37 pm
4060
... Agreed; this should tie in with type inference and annotation. This stack effect notation is really an abbreviated form of type notation and static...
... The Forth community's experience strongly suggests that there is. Words with externally visible variable stack effects are frowned upon. ... -Wm...
... It seems to me that the way to handle this is to simply require a normal type annotation that provides enough information to figure these things out. There...
John Nowak
john@...
May 21, 2008 2:00 am
4063
... After a brief review, this is clearly bogus. For example, we might have a 'loop' combinator that simply executes a procedure repeatedly: loop :: A (A -> A)...
John Nowak
john@...
May 21, 2008 7:02 am
4064
After doing some thinking, I've come up with an example of where an n- ary 'dip' combinator makes a complete mess of things. The example is Factor's 'bi@'...
John Nowak
john@...
May 21, 2008 8:08 am
4065
... Minor correction: The type is 'A b b (A b -> A) -> A'. Too much curry. - John...
John Nowak
john@...
May 21, 2008 8:15 am
4066
... On the other hand this looks like a turing-complete programming language at the type level. Perhaps if you go that route, and not worry about decidability,...
... I agree; for a language with static typechecking, this makes complete sense. If you don't have static typechecking but you want to do static stack depths,...
... Great point. Here we seem to actually *need* type annotations on the function types... I wonder whether it might be a fundamental property and not just an...