Re: what's new continued

2002-07-03 Thread Ariel Scolnicov
Ariel Scolnicov <[EMAIL PROTECTED]> writes: [...] > will apply to any method? To any sub? Can I call a sub 17 times by > saying > > (undef) x 17 = foo(1,2,3); That should be (undef) x 17 = ^foo(1,2,3); of course. Sorry. [...] -- Ariel Scolnicov|http:/

Re: what's new continued

2002-07-03 Thread Ariel Scolnicov
=== > : > : > if ($x == any($a, $b, $c) { ... } > > The wave function of QS has not yet collapsed in Perl 6. > It's still in the same state(s) as the cat. I believe you will find that it is impossible to copy a quantum wave function. -- Ariel Scolnic

Re: Apoc 5 questions/comments

2002-06-10 Thread Ariel Scolnicov
e to get > these days. > Cut the Smalltalk. It's off-topic. -- Ariel Scolnicov

Re: stringification of objects, subroutine refs

2002-05-11 Thread Ariel Scolnicov
le situation. Every time I want to serialize a bunch of closures, I have to serialize all of them in one go. And I have to deserialize them all if I want to access any bit of them. What do I do if I have 10_000 copies of some huge bunch, and I want to access just one bit of it? Seems lik

Re: Loop controls

2002-04-30 Thread Ariel Scolnicov
t to steal features from that powerful language): PLEASE ABSTAIN -- Ariel Scolnicov|http://3w.compugen.co.il/~ariels Compugen Ltd. |[EMAIL PROTECTED]"Sometimes people write an 72 Pinhas Rosen St.|Tel: +972-3-7658117 accidental haiku. Damn! Tel-Aviv 69512

Re: Regex and Matched Delimiters

2002-04-23 Thread Ariel Scolnicov
r (like ASCII 32) is going to produce many references to the FAQ "Why doesn't /a word/ match 'a word'?". (Having to escape #s is not as bad, as they are less common). [...] -- Ariel Scolnicov|http://3w.compugen.co.il/~ariels Compugen Ltd. |[EMAIL

Re: Defaulting params

2002-04-11 Thread Ariel Scolnicov
most one * named arguments Note that the first 2 *can* be done together (but I'm not sure that would be a good idea, either). And we already have 3, kinda, by passing a hash of arguments. -- Ariel Scolnicov|http://3w.compugen.co.il/~ariels Compugen Ltd. |[EMAIL PROTECTED] 72

Re: [A-Z]+\s*\{

2002-01-21 Thread Ariel Scolnicov
, not to continually frustrate them. I'd be inclined to > let people choose their own level of pain by setting DbC strictness > thresholds. Please set my threshold of side effect pain to undef... -- Ariel Scolnicov|http://3w.compugen.co.il/~ariels Compugen Ltd. |[EMAIL PROTECTED] 72 Pinhas Rosen St.|Tel: +972-3-7658117 "fast, good, and cheap; Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555 pick any two!"

Re: Damian Conway's Exegesis 2

2001-05-16 Thread Ariel Scolnicov
\n"; print $x; then (I hope) we're agreed printing would happen in the *wrong* order (first the output of show($root, $post), then the value of $x (and $x eq "Post order: \n"). So how come `print' gets to mung about with evaluation order? [...] Hoping for illumination,

Re: Please make "last" work in "grep"

2001-05-03 Thread Ariel Scolnicov
Lazy. But it would need a completely different algorithm. Which is not too bad. And even my ($first, $second, $third) = sort {...} @list; is kind-of plausible. So we'd definitely want ((undef)x((@list+1)/2), $median) = sort {...} @list; to apply Perl's patented MindReader(tm)

Re: Larry's Apocalypse 1

2001-04-10 Thread Ariel Scolnicov
print $_; > >} > > to dump the HTML for the main page of www.perl.org to get dumped to stdout. > > Well, this seems innocent enough, but how far do you want to stretch it? use ICBM; unlink 'http://www.macrosoft.com/'; # You get the idea Just as

Re: Larry's Apocalypse 1

2001-04-09 Thread Ariel Scolnicov
ed to be SHORT. `--cmd' is LONG. If we MUST go the multiflagged way, why not reflect `-e' to get the `-6' flag? At the very least, I want a short flag! -- Ariel Scolnicov

Re: Schwartzian Transform

2001-03-28 Thread Ariel Scolnicov
the above 2 senses; you can always memoize (2), and you can do (3) if the semantics of it are "good enough" for what you want to do). So you can say use Memoize; # ... memoize 'f'; @sorted = sort { my_compare(f($a),f($b)) } @unsorted to get a lot of the effect of the S

Re: assign to magic name-of-function variable instead of "return"

2001-02-07 Thread Ariel Scolnicov
ocs/cltl/clm/node96.html . > All that POST and such do, is obfuscate the flow of control. I doubt > that outweighs the small benefits. However, unwind-protect is useful. It's either use that or use something destructor-related. That just sits on top of some unwind-protect-like hac

Re: TIL redux (was Re: What will the Perl6 code name be?)

2000-10-24 Thread Ariel Scolnicov
like that. So almost all the things you'll be threading will be words from the Perl core (rather than words defined in the program). [...] > inline threaded code is something whose time has come again. Agreed. But does it have to do it here? :-( -- Ariel Scolnicov|"GCAAGAATT

Re: Why does atan2 take 2 arguments?

2000-10-17 Thread Ariel Scolnicov
te slope. > It also allows the function to unambiguously assign the correct quadrant. To expand: consider the results of atan2(1,1) and atan2(-1,-1). Now compare with the results of atan(1) and, well, atan(1). Slopes are the same going "up" and "down", but the angle is

Re: IDEA: lexically scoped subs anyone

2000-09-30 Thread Ariel Scolnicov
ursive objects using the (letrec ...) form. In Scheme, say: (letrec ((even? (lambda (x) (if (= x 0) t (odd? (- x 1) (odd? (lambda (x) (if (= x 0) nil (even? (- x 1)) (even? 11)) [No, this is not a good way to write these functions.] I'm uns

Re: RFC 290 (v1) Remove -X

2000-09-26 Thread Ariel Scolnicov
file: > > is_text > is_sticky > is_writable I refer you to my previous message (archived in http://tmtowtdi.perl.org/archive?35:mss:4575). Basically, not have a prefix predicates should have! Another option is to stuff the long names into some namespace, and export them up

Re: Perl6Storm: Intent to RFC #0101

2000-09-24 Thread Ariel Scolnicov
hers) speak, and saying "readable(file)"? The "is_" prefix serves only to make predicates impossible to read out, leading to thinkos. [...] -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +97

Pre-withdrawal notice for RFC184

2000-09-18 Thread Ariel Scolnicov
there is no call for this RFC. Unless I hear otherwise from people interested in the RFC, I shall be withdrawing it Friday. -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-5713025 (Jerusalem) \ We recycle all our Hz

Re: RFC 111 (v3) Here Docs Terminators (Was Whitespace and Here Docs)

2000-09-14 Thread Ariel Scolnicov
ocument line. The same (without indentation, of course) works for Perl today, and confuses no-one. And just because Perl has some feature does not mean you are obligated to use it in all programs. -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compuge

Re: RFC 111 (v3) Here Docs Terminators (Was Whitespace and Here Docs)

2000-09-14 Thread Ariel Scolnicov
FIRST_HERE_DOC; print << SECOND_HERE_DOC; This is on the left margin. This is indented one char. FIRST_HERE_DOC This is indented one char. This is on the left margin. SECOND_HERE_DOC But (1) needs to be resolved (and don't say "use tabs 8"!). --

Re: RFC 179 (v1) More functions from set theory to manipulate arrays

2000-09-11 Thread Ariel Scolnicov
on. When I started reading this thread, I was *sure* it would be immediately clear that sets are bit vectors, drawn on some pre-specified world! -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-5713025 (Jerusalem) \

Re: $a in @b

2000-09-11 Thread Ariel Scolnicov
e to do its things. And while you are doing > that please take this EXPR from me. When you put it this way, isn't C spelled C in Perl5? (Except, of course, that C inside a C does a whole lot more nowadays). -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"

Re: RFC 114 (v2) Perl resource configuration

2000-09-04 Thread Ariel Scolnicov
ig. BTW, > it's not something I'm against, I'm just trying to find a way I could use > it. But for this to work, the users must not have filesystem access to the installed modules (otherwise they'll just C). In which case the whole point is moot. [...] -- Ariel Sc

Re: RFC 111 (v3) Here Docs Terminators (Was Whitespace and Here Docs)

2000-09-04 Thread Ariel Scolnicov
of C is unclear. This issue was raised during previous discussion of the RFC. -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-5713025 (Jerusalem) \ We recycle all our Hz 72 Pinhas Rosen St.|Tel: +972-3-7658514 (M

Re: RFC 184 (v1) Perl should support an interactive mode.

2000-09-04 Thread Ariel Scolnicov
can pass a string and know if it has a chance of being completed into a syntactically legal construct (this is a difference between "2+" and "))};;"). Access to the parser needs to be in the core... -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL P

Re: RFC 114 (v2) Perl resource configuration

2000-09-01 Thread Ariel Scolnicov
l it what type of C code the system administrator has decided to mandate! Configuration files for C, an interactive Perl, C, and any other application written in Perl are a nice idea (one that TomC seems to support). This has nothing to do with wanting to configure the language itself. [...] -- Ariel S

Re: RFC 184 (v1) Perl should support an interactive mode.

2000-08-31 Thread Ariel Scolnicov
configuration files for code. But I fear actually evaluating > configuration data (even in tainted mode). The end result is that I come up > with my own syntax which I parse with reg-exs. Sadly I find myself > reproducing the complexity of hashes / arrays needlessly. Ideally

Re: RFC 122 (v1) types and structures

2000-08-29 Thread Ariel Scolnicov
nite loop results. I don't think we want this to happen automatically in Perl. Languages with assignments do not have readily-comprehensible closures (see e.g. Scheme's call/cc (call-with-current-continuation), which has well defined but difficult semantics). For one thing, closures in the

Re: RFC 111 (v2) Here Docs Terminators (Was Whitespace and Here Docs)

2000-08-28 Thread Ariel Scolnicov
text. # This isn't a comment; it's part of the here-document! #EOT#2#This is a comment I'm not sure if this is a good idea. However, bear in mind that if you want a comment on the end-of-here-document line, you probably aren't going to add more `#' characters to

Re: Pre-RFC: Require a warning on spaces after here-document "terminator"

2000-08-21 Thread Ariel Scolnicov
give me a regex getline terminator or pattern matches against > filehandles (a la RFC 93) and I'll never mention $/ again ;-) Heresy! AWK has to be better for something :-) -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel

Pre-RFC: Require a warning on spaces after here-document "terminator"

2000-08-20 Thread Ariel Scolnicov
I was asked to debug a weird Perl5 problem yesterday. The code in question looked roughly like this (indented 4 spaces, but otherwise unchanged): #!perl -w use strict; print

Re: Maximum length input lines

2000-08-19 Thread Ariel Scolnicov
of data with no line termination, Perl will require at least 128GB of swap to read it all in. This is an easy denial of service attack (for large values of "128"). Using substr would not be an option, as the damage is done before substr ever gets to see the "li

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread Ariel Scolnicov
e of suffocation at speeds above 12kmh" old-fashioned perl4-head !@#$&*#@$[->}})[-lovers will have a concrete proposal in front of our eyes. I contend that any consistently extendable proposal will lead to horrors at least on the scale of the example above. I hate the example abo

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread Ariel Scolnicov
John Porter <[EMAIL PROTECTED]> writes: > Ariel Scolnicov wrote: > > John Porter <[EMAIL PROTECTED]> writes: > > > foo = bar; > > > > > > foo could be just about anything: a string, a hashref, some other > > > blessed ref (with op"

Re: RFC 114 (v1) Perl resource configuration

2000-08-17 Thread Ariel Scolnicov
the way". This is scary. Until, that is, we add the inevitable "-." flag to avoid loading rc files, and then all scripts will start with "#!perl -w.". -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +

Re: RFC 76 (v1) Builtin: reduce

2000-08-17 Thread Ariel Scolnicov
Nathan Torkington <[EMAIL PROTECTED]> writes: > Piers Cawley writes: > > > > The $a and $b of the sort comparator were A Bad Idea to begin with. > > > > > > Ditto. Can we ditch these in Perl 6? Don't see why $_[0] and $_[1] can't > > > be used, or even a more standard $1 and $2. Either one makes

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-17 Thread Ariel Scolnicov
probably take a look at Algol68 references; I've never actually seen an Algol program, but I seem to remember a professor at the university going on about how Algol68 did _some_ dereferencing automatically. -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED]

Re: RFC 84 (v1) Replace => (stringifying comma) with =>

2000-08-16 Thread Ariel Scolnicov
tage of hashes over arrays you refered to. It seems like a tied hash would be suitable for what you want. If ties were efficient, it would be trivial to implement a SortedHash which would perform "each"-style accesses in sorted order. Standard Perl library, anyone? -- Ariel Scolnicov

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-14 Thread Ariel Scolnicov
respects ordering; then the above merge would produce [1,2,3,4,5,6,7,8]). [...] It's called `zip'. Really. -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-6795059 (Jerusalem) \ We recycle all our

Re: RFC 94 (v1) Rename @ARGV to @ARGS

2000-08-11 Thread Ariel Scolnicov
Saying @ARGS it a bit like saying argumentses. [...] -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-6795059 (Jerusalem) \ We recycle all our Hz 72 Pinhas Rosen St.|Tel: +972-3-7658514 (Main office)`

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Ariel Scolnicov
th's WEB uses `tangle' and `weave' (not as antonyms)). The advantage of `zip' is that that is the name of the operation being performed. -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-6795059 (Jerusale

Re: RFC 76 (v1) Builtin: reduce

2000-08-10 Thread Ariel Scolnicov
ment. You're computing (($list[0]+$list[1])/2 + $list[2])/2 + ... for some reason. Knowing the reason will let you find the desired result for an empty list. Note that just I C require a non-empty list points out this subtlety. [...] -- Ariel Scolnicov|"GCAAGAATTGAACTG

Re: RFC 85 (v1) All perl generated errors should have a

2000-08-10 Thread Ariel Scolnicov
ed point). E.g. 1234567 represents error 4567 in class 123. 2. Error codes as digit strings with decimal point. So "123.4567" (_not_ 123.4567) represents error 4567. People will still try stupid floating-point math tricks to get at the suberror code, but at least we'll know

Re: RFC 76 (v1) Builtin: reduce

2000-08-10 Thread Ariel Scolnicov
Chaim Frenkel <[EMAIL PROTECTED]> writes: > >>>>> "AS" == Ariel Scolnicov <[EMAIL PROTECTED]> writes: > > >> If the original list has no elements, C immediately returns C. > > AS> I like everything except this part. Reducing an empt

Re: RFC 76 (v1) Builtin: reduce

2000-08-10 Thread Ariel Scolnicov
is always evaluated in a scalar context (for things to make sense). -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-6795059 (Jerusalem) \ We recycle all our Hz 72 Pinhas Rosen St.|Tel: +972-3-7658514 (Main office

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Ariel Scolnicov
ot;use strict", where I can limit my search to variable declarations (and "use strict vars" for globals, if in effect). Variable declaration is good (except for some trivial programs)! -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED]

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Ariel Scolnicov
till override the scopes I propose with an explicit > my or our. Admittedly, 'blocks' is not nearly as big a benefit as 'subs' > is, but has some applications, particularly if you're a "likes anonymous > blocks" kind of person (which some people are).

Re: RFC: Rename local() operator

2000-08-07 Thread Ariel Scolnicov
lue for somewhere else as well as here. Other names > suggested (like "shadow", or "mask") convey that idea better than > "here". It doesn't have the value "\n" I, it has the value "\n" I! { now $/ = "\n"; call_complicated_sub;

Re: Infinite lists (was Re: RFC 24 (v1) Semi-finite (lazy) lists)

2000-08-06 Thread Ariel Scolnicov
time it's called with the same arguments. Then perl would be > smart enough to cache the result of calls to this sub to avoid recalculating > it again later. Personally, however, I find this approach less intuitive. MJD has a perl5 package which does memoization; this is exactly what yo

Re: RFC 24 (v1) Semi-finite (lazy) lists

2000-08-06 Thread Ariel Scolnicov
"Jeremy Howard" <[EMAIL PROTECTED]> writes: > > Ariel Scolnicov wrote: > > Consider C. Clearly, this > > "should" generate the "list" C<(..0)>. But it doesn't! Here's what > > really happens: Perl says to itself "

Re: RFC 24 (v1) Semi-finite (lazy) lists

2000-08-06 Thread Ariel Scolnicov
"Jeremy Howard" <[EMAIL PROTECTED]> writes: > Ariel Scolnicov wrote: > > <...infinite lists...> > > This (and your preceeding messages on the subject) is unfortunately > > not possible to do in a clean manner; for that matter, neither is the >

Re: RFC 24 (v1) Semi-finite (lazy) lists

2000-08-05 Thread Ariel Scolnicov
numbers onto the integeers. Note that the ordering is different than ...,-2,-1,0,1,2,... Similarly, the only useful meaning of C<@negs = (..-1)> would simply be C<@negs = map {-$_} (1..)>, and the ordering of the result is again "wrong". Somebody please prove

Re: RFC 44 (v1) Bring Documentation Closer To Whatever I

2000-08-05 Thread Ariel Scolnicov
Jarkko Hietaniemi <[EMAIL PROTECTED]> writes: > On Sun, Aug 06, 2000 at 12:41:50AM +0300, Ariel Scolnicov wrote: [...] > > Have you looked at the documentation that SWIG auto-generates? > > Nope. Can you give a quick summary? SWIG is a tool for interfacing C (an

Re: RFC 44 (v1) Bring Documentation Closer To Whatever I

2000-08-05 Thread Ariel Scolnicov
the thing it documents > that they can see each others' nose hair. Have you looked at the documentation that SWIG auto-generates? -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-6795059 (Jerusalem) \ We recycle

Re: RFC 44 (v1) Bring Documentation Closer To Whatever I

2000-08-05 Thread Ariel Scolnicov
t documentation, I'm for anything that doesn't require it to do anything. Typing is also nice for this sort of thing; if we say ##@ Update DiLithium levels sub foo(int $x) { my DiLithium $ret; # ... all returns are via $ret ... $ret; } then Perldoc6 should be able to know that foo

Re: Deep copy

2000-08-05 Thread Ariel Scolnicov
deep copy makes sense even when no assignment is involved (hence the `copy' suggestion above). However, no less useful than deep copy is k-level copy, especially when k==1. Before long, we'll have `=', `:=', `<-' and maybe `===' operators in the language, for the diff

Re: PDL-P: Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-05 Thread Ariel Scolnicov
Tuomas Lukka <[EMAIL PROTECTED]> writes: > On 4 Aug 2000, Ariel Scolnicov wrote: > > > Karl Glazebrook <[EMAIL PROTECTED]> writes: > > > > > OK I will raise to the bait > > > > > > I think it's a bit unfair to say that PD

Re: PDL-P: Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-04 Thread Ariel Scolnicov
yntax into the core of Perl6. It's > convenient and almost standard. Put the dots sideways, and it's Perl. Regarding multi-dimensional arrays, the PDL porters are undoubtable champions; what is required? [...] -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"|

Re: RFC 29 (v1) unlink() should be left alone

2000-08-04 Thread Ariel Scolnicov
an implementation detail of the platform on which the library is running. Since all remove() does is break the association between the name and the contents, links are a red herring. [...] -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd.

Re: RFC 24 (v1) Semi-finite (lazy) lists

2000-08-04 Thread Ariel Scolnicov
or is slurped in in one go. As you can see, this is the least thought-out bit of my proposal. Another example of a "virtually" semi-infinite iterator is any file handle. "perl -p" is just "print map { ... } <>", if "<>" is an input itera

Re: RFC: lexical variables made default (revised)

2000-08-03 Thread Ariel Scolnicov
at you're proposing seems to be the abolition of *all* scopes from Perl, except the innermost-sub scope. This is worse than Pascal. But here's an idea: suppose you spelt `my' V-A-R. Then you could say Perl is forcing you to declare all your variables (which I claim is essential i

Re: RFC 16 (v1) Keep default Perl free of constraints su

2000-08-03 Thread Ariel Scolnicov
ing a one-liner doesn't need is to add a `-nobondage-and-discipline' flag, so we can't put any compulsory flags *there*. And `-w' should be the default, as we all know, so we can't put any compulsory flags on the serious programs, either! -- Ariel Scolnicov|"GCAA

Re: Random items (old p5p issues)

2000-08-01 Thread Ariel Scolnicov
continuations. Scheme's R4RS and R5RS are also interesting reading about continuations (look for call-with-current-continuation, aka call/cc). -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-6795059 (Jerusalem) \ We re

Reduce [was: Re: Random items (old p5p issues)]

2000-08-01 Thread Ariel Scolnicov
fer)? Perl5 almost has it, I think. reduce operation list map operation list multimap operation list-of-lists # uurgh. [...] -- Ariel Scolnicov|"GCAAGAATTGAACTGTAG"| [EMAIL PROTECTED] Compugen Ltd. |Tel: +972-2-6795059 (Je

Re: RFC: On-the-fly tainting via $^T

2000-08-01 Thread Ariel Scolnicov
onfuse; it should be written with a block, correctly restoring the old value of $^T. Footnotes: [1] For efficiency, you'd probably still want some command-line option, perhaps -T itself, to say "this program involves taint checking, so please keep track of tainted values". That wa