explicit laws about whitespace in rules
I'd like to know where EXACTLY whitespace is permitted in rules. Is it legal to write \c [CHARACTER NAME] or must I write \c[CHARACTER NAME] -- Jeff japhy Pinyan % How can we ever be the sold short or RPI Acacia Brother #734 % the cheated, we who for every service http://japhy.perlmonk.org/ % have long ago been overpaid? http://www.perlmonks.org/ %-- Meister Eckhart
Re: explicit laws about whitespace in rules
Jeff 'japhy' Pinyan wrote: I'd like to know where EXACTLY whitespace is permitted in rules. Is it legal to write \c [CHARACTER NAME] or must I write \c[CHARACTER NAME] The latter, I believe. It's a single token. Damian
Re: lazy context
Hi, Yuval Kogman nothingmuch at woobling.org writes: we have a lazy modifier: my $a = lazy { get_value(5, 10) }; as of r3739 implemented in Pugs. :) The only builtin feature that needs to be added is that coroutines can masquerade as their return value, and not a code reference, but AFAIK proxy objects will give us that anyway, right? Yep: my $a := new Proxy: FETCH = { get_value(5, 10) }; (FWIW, I'd like to see lazy in the core, too, but I don't have a strong opinion on this.) --Ingo -- Linux, the choice of a GNU | Row, row, row your bits, gently down the generation on a dual AMD | stream... Athlon!|
Perl development server
Hi, because I see some people struggle to get things like GHC working, and then to get make and a compiler working, and because some people have limited bandwidth which makes big svn updates a less pleasant experience, and for other reasons, I decided to have my company, Convolution, sponsor a shell server. It will be a simple server, with an Intel main board, a Pentium 4 2.4 GHz CPU, 1024 MB of RAM and 80 GB of mirrored (raid1) diskspace. On the software side, there will be Debian GNU/Linux Sid, with all software required to compile Parrot and Pugs installed. Using Apache, users can publish files for http access. Twistspace, a Dutch colocation provider, is so kind to sponsor rackspace and connectivity. My current estimate is that the machine will be online and accessible by the end of this week. Everyone who wants, can get a login. Access is provided via SSH version 2 only (Windows users can use PuTTY and WinSCP), and the box may be used for everything that improves Perl 6 development. Users are encouraged to keep files world readable for transparency. If you want access, please let me know. I will send you a temporary password by e-mail, that I expect you to change the first time you get the chance. Please let me know which software you want installed. If it's in Debian and doesn't conflict with other software, you can have it (but no X or openoffice, or the like). If it's not in Debian, you'll have to compile it yourself. The box won't have an SVN mirror unless someone puts it there. There won't be a smoke test unless someone writes the script. It's a community machine, and users are expected to fill in the details. Also, this new machine needs a hostname. Please help me think of a cute name! I prefer a short hostname with less than 9 letters. I have sent this message to perl6-language and perl6-compiler. Please CC replies back to me if you read it on p6c, because I'm not subscribed to that list. Regards, Juerd P.S. No guarantees of any kind are made. If I turn BOFHish one day, you may find your account removed just because I liked it :) -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Perl development server
If you want access, please let me know. I will send you a temporary password by e-mail, that I expect you to change the first time you get the chance. I'd like one. The box won't have an SVN mirror unless someone puts it there. There won't be a smoke test unless someone writes the script. It's a community machine, and users are expected to fill in the details. Maybe we should divvy these tasks out. It wouldn't do that have two people smoke-testing on the exact same machine or to have two SVN mirrors ... Also, this new machine needs a hostname. Please help me think of a cute name! I prefer a short hostname with less than 9 letters. dev.pugscode.org seems indicated ... Rob
Re: Perl development server
Rob Kinyon skribis 2005-05-23 11:22 (-0400): I'd like one. Sure - just think of a nice catchy username! :) Maybe we should divvy these tasks out. It wouldn't do that have two people smoke-testing on the exact same machine or to have two SVN mirrors ... Good idea, will you take the task of managing these decisions? dev.pugscode.org seems indicated ... Sorry, but 'dev' isn't cute enough :). And it's going to be something.perl6.nl, probably. I don't mind aliases, though, but they better be CNAMEs. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Perl development server
On 5/23/05, Juerd [EMAIL PROTECTED] wrote: Rob Kinyon skribis 2005-05-23 11:22 (-0400): I'd like one. Sure - just think of a nice catchy username! :) robkinyon please - it's catchy enough. Maybe we should divvy these tasks out. It wouldn't do that have two people smoke-testing on the exact same machine or to have two SVN mirrors ... Good idea, will you take the task of managing these decisions? Unfortunately, I have no tuits, otherwise I would love to. Porting PREFIX from EU::MM to M::B is going to take all of my available time, assuming I have any after the baby's born. Rob
Re: Perl development server
Hi, I'd like one. Sure - just think of a nice catchy username! :) I'd like another one, as boogie. I think now, that I will use it, but I have a lot of jobs these days, with higher priorities :( than Perl6. dev.pugscode.org seems indicated ... Sorry, but 'dev' isn't cute enough :). And it's going to be something.perl6.nl, probably. I don't mind aliases, though, but they better be CNAMEs. I can offer a subdomain of perl6.hu, too - as a CNAME. ;) I think, the cute name can be about animals. A camel and a parrot are in my mind. Or what about camelseeks.org/perlseeks.org? It sounds like camel6 and perl6. Bye, Andras
Re: Perl development server
On Mon, May 23, 2005 at 05:25:57PM +0200, Juerd wrote: dev.pugscode.org seems indicated ... Sorry, but 'dev' isn't cute enough :). And it's going to be something.perl6.nl, probably. I don't mind aliases, though, but they better be CNAMEs. How about dev.perl6.nl -- I'll CNAME dev.pugscode.org there. Thanks, /Autrijus/ pgpGUmeOXhmxD.pgp Description: PGP signature
Re: Perl development server
Hi! On Mon, May 23, 2005 at 05:18:45PM +0200, Juerd wrote: Everyone who wants, can get a login. me too! 'domm' please. Also, this new machine needs a hostname. Please help me think of a cute name! I prefer a short hostname with less than 9 letters. onion Access to this machine would also be handy for participants of the Austrian Perl Workshop Parrot/Pugs hack-a-thon: http://conferences.yapceurope.org/apw2005 While I will inform everyone what they need, I'm sure quite a lot people will show up without a fresh checkout of the various repositories. So if I can get a number of dummy accounts (to be deleted after the event) that would be great! BTW, will all users on this machine share one svn working copy or is everyone supposed to to his/her own checkout? Or is this one of the things someone should organise? -- #!/usr/bin/perl http://domm.zsi.at for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}
Re: Perl development server
On Mon, May 23, 2005 at 05:18:45PM +0200, Juerd wrote: Hi, Hello :) because I see some people struggle to get things like GHC working, and then to get make and a compiler working, and because some people have limited bandwidth which makes big svn updates a less pleasant experience, and for other reasons, I decided to have my company, Convolution, sponsor a shell server. Lots of thanks for this. A dedicated server will make my life easier, at least. If you want access, please let me know. I will send you a temporary password by e-mail, that I expect you to change the first time you get the chance. I'd like a login, username wolverian. Thanks! Please let me know which software you want installed. If it's in Debian and doesn't conflict with other software, you can have it (but no X or openoffice, or the like). If it's not in Debian, you'll have to compile it yourself. All I need are the basics - vim, scp. I think those are installed by default, anyway. A perl-enabled version of vim would be nice. -- wolverian signature.asc Description: Digital signature
Re: Perl development server
Juerd, I would like an account too, username 'stevan' please. On May 23, 2005, at 11:25 AM, Juerd wrote: dev.pugscode.org seems indicated ... Sorry, but 'dev' isn't cute enough :). And it's going to be something.perl6.nl, probably. I don't mind aliases, though, but they better be CNAMEs. lambdacamels.perl6.nl? Stevan Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Perl development server
BÁRTHÁZI András skribis 2005-05-23 17:40 (+0200): I think, the cute name can be about animals. A camel and a parrot are in my mind. Parrot can't be, because that's also the name of one of the projects, and I want to avoid confusion. Camel -- sorry, but years of Perl still haven't convinced me they are cute animals :) Besides, it feels wrong to see a camel in Perl context without the text used with permission. (Even though that is only required with images) Or what about camelseeks.org/perlseeks.org? It sounds like camel6 and perl6. The domain already exists, but if you want to register additional domains, go right ahead. Ask me for DNS information later. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Perl development server
Stevan Little skribis 2005-05-23 12:00 (-0400): I would like an account too, username 'stevan' please. Will be arranged. lambdacamels.perl6.nl? I like it, but singular (as it identifies the machine itself, not its users). Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Perl development server
Thomas Klausner skribis 2005-05-23 18:03 (+0200): While I will inform everyone what they need, I'm sure quite a lot people will show up without a fresh checkout of the various repositories. So if I can get a number of dummy accounts (to be deleted after the event) that would be great! hackathon1..hackathon9, or do you need more? BTW, will all users on this machine share one svn working copy or is everyone supposed to to his/her own checkout? Or is this one of the things someone should organise? There may be a local mirror to minimize bandwidth (if someone arranges this to happen), but every uses should have their own working copy, because otherwise versioning systems don't work too well: you would be committing someone else's changes, for which you don't know a good log entry, and the logs no longer show the correct user names. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Hackathon users (was: Perl development server)
Hi, Thomas Klausner skribis 2005-05-23 18:03 (+0200): While I will inform everyone what they need, I'm sure quite a lot people will show up without a fresh checkout of the various repositories. So if I can get a number of dummy accounts (to be deleted after the event) that would be great! hackathon1..hackathon9, or do you need more? BTW, will all users on this machine share one svn working copy or is everyone supposed to to his/her own checkout? Or is this one of the things someone should organise? There may be a local mirror to minimize bandwidth (if someone arranges this to happen), but every uses should have their own working copy, because otherwise versioning systems don't work too well: you would be committing someone else's changes, for which you don't know a good log entry, and the logs no longer show the correct user names. I think that, for hacking there's no need for users on a remote machine, if the hackers has a computer, they can develop locally, has a repo locally. Or if you can offer computers locally, you can install an environment for them (or maybe you would like to take out these installs with this server?). If there will be new projects starting there, then it would be nice to share them with a server for other people, to get it after the conference, and join. But it needs an SVN server, at least, and an easy to setup plain project site skeleton. I think it would be nice, if somebody can prepare these tools for both Hackathon, and for other people as well. Bye, Andras
Re: Perl development server
Hi, I think, the cute name can be about animals. A camel and a parrot are in my mind. Parrot can't be, because that's also the name of one of the projects, and I want to avoid confusion. I just thinking something related these animals, not the animal. Maybe feather, etc. It's not the big idea itself. ;) Camel -- sorry, but years of Perl still haven't convinced me they are cute animals :) Besides, it feels wrong to see a camel in Perl context without the text used with permission. (Even though that is only required with images) I have no these thoughts about camel, but it's your decision. However, I like onion, what Thomas recommended. Or what about camelseeks.org/perlseeks.org? It sounds like camel6 and perl6. The domain already exists, but if you want to register additional domains, go right ahead. Ask me for DNS information later. You mean, that you would like to create a subdomain for perl6.nl? Bye, Andrs
Re: Perl development server
Nathan Gray skribis 2005-05-23 12:50 (-0400): Sorry, but 'dev' isn't cute enough :). And it's going to be something.perl6.nl, probably. I don't mind aliases, though, but they better be CNAMEs. Juerd, why am I getting everyone's responses, but not your original messages? I have no idea. I'm sending these messages to the two mailing lists, and from there on, I can't track where they're going (or not) Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Perl development server
Thomas Klausner skribis 2005-05-23 18:03 (+0200): onion Sorry, I had previously overlooked this lone paragraph. I like onion the best so far. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Perl development server
How about zephyr. On Mon, 23 May 2005 18:55:29 +0200, Juerd [EMAIL PROTECTED] said: Thomas Klausner skribis 2005-05-23 18:03 (+0200): onion Sorry, I had previously overlooked this lone paragraph. I like onion the best so far. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Perl development server
[EMAIL PROTECTED] skribis 2005-05-23 13:58 (-0500): I like onion the best so far. How about zephyr. The building my grandmother lives in is called Zephyr. For me, the word is strongly associated with old people, and not at all with programming :) While an onion has many layers that together make a single whole that adds taste to almost any meal, which I think is a nice view of Perl 6. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: reduce metaoperator on an empty list
HaloO Mark, please don't regard the following as obtrusive. you wrote: If as usual the definition of a right identity value e is that a op e = a for all a, then only +inf works. Besdies you example should have been; Or actually $n % any( abs($n)+1 .. Inf ) to really exclude 0 from the junction. $n % any (($n+1)..Inf), $n % $n = 0. That depends on the definition of % and the sign of $n. With the euclidean definition 0 = ($n % $N == $n % -$N) abs($N) and for $n 0 there's no identity at all. The identity element has to be an element of the set, which +Inf isn't. It's a type. BTW, is % defined as truncation in Perl6? That would be a bit unfortunate. Simple but not well thought out. -- TSa (Thomas Sandlaß)
Re: Perl development server
On Mon, 23 May 2005 14:58:20 -0400, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How about zephyr. No! That's the name of a project I'm working on dang it ;)
Re: Perl development server
It reminds me of minor league baseball and roller coasters...anyway, onion seems somehow appropriate since they also make the people kitchen cry ;) On Mon, 23 May 2005 21:00:51 +0200, Juerd [EMAIL PROTECTED] said: [EMAIL PROTECTED] skribis 2005-05-23 13:58 (-0500): I like onion the best so far. How about zephyr. The building my grandmother lives in is called Zephyr. For me, the word is strongly associated with old people, and not at all with programming :) While an onion has many layers that together make a single whole that adds taste to almost any meal, which I think is a nice view of Perl 6. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
Re: Perl development server
Andy Bach wrote off-list: Isn't Abigail the golfer, YA excellent PH, FunWithPerl, er guy? I think camels are Fido and Amelia: http://www.perlmonks.org/?node=31716 You're right, of course. I knew it was one of those A names... -- Brent 'Dax' Royal-Gordon [EMAIL PROTECTED] Perl and Parrot hacker
Re: lazy context
Yuval Kogman wrote: The only builtin feature that needs to be added is that coroutines can masquerade as their return value, and not a code reference, but AFAIK proxy objects will give us that anyway, right? Hmm, isn't the same achieved by considering Eager and Lazy as subtypes of Code? E.g. infix:{'='}:(Array:Eager -- Eager) would not flatten but store the incoming value and return it for chaining assignment. -- TSa (Thomas Sandlaß)
Re: Declaration of my() variables using symbolic referentiation
Ingo Blechschmidt wrote: am I correct in the assumption that the following is an error? # Not in a BEGIN block my $::(calc_varname()) = 42; The more interesting question is: how do you expect to adress the var in the code that follows? I guess the compiler won't have a problem with taking $::(calc_varname()) as a variable name. The name doesn't appear anywhere outside the scope anyway. But you should also not expect any calc_varname beeing called at runtime. And at most once during compile time. I think so, as my() is a compile-time operation, but in this example, the variable name is not known until runtime, so I think this should be forbidden. Correct? Well, my has got a runtime counterpart which creates a fresh set of local variables everytime the code object is invoked. -- TSa (Thomas Sandlaß)
Intervals
Just came across something cool on the frink mailing list - was wondering if perl6 had any intention on implementing this, or if not natively, ideas on what would be the best way of implementing it in perl6. They have the intent (Alan Eliasen has the intent) of implementing 'intervals' which match fuzzy values where you know an approximate extent of the value, but not the value itself. E.g (.5 ... .75) * (.5 ... .8) == (.25 ... .6) Given that frink values can have units like gallons or pounds, and they intend on tracking accuracy inside of intervals, with different distributions, this is especially powerful. Is there the intent to have intervals in perl6, or would it be better just to port frink to parrot and be done with it? Ed
Re: reduce metaoperator on an empty list
There are actuall two usefull definition for %. The first which Ada calls 'mod' always returns a value 0=XN and yes it has no working value that is an identity. The other which Ada calls 'rem' defined as follows: Signed integer division and remainder are defined by the relation: A = (A/B)*B + (A rem B) where (A rem B) has the sign of A and an absolute value less than the absolute value of B. Signed integer division satisfies the identity: (-A)/B = -(A/B) = A/(-B) It does have a right side identity of +INF. -- Mark Biggar [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] HaloO Mark, please don't regard the following as obtrusive. you wrote: If as usual the definition of a right identity value e is that a op e = a for all a, then only +inf works. Besdies you example should have been; Or actually $n % any( abs($n)+1 .. Inf ) to really exclude 0 from the junction. $n % any (($n+1)..Inf), $n % $n = 0. That depends on the definition of % and the sign of $n. With the euclidean definition 0 = ($n % $N == $n % -$N) abs($N) and for $n 0 there's no identity at all. The identity element has to be an element of the set, which +Inf isn't. It's a type. BTW, is % defined as truncation in Perl6? That would be a bit unfortunate. Simple but not well thought out. -- TSa (Thomas Sandlaß)
Re: Intervals
On 5/23/05, Edward Peschko [EMAIL PROTECTED] wrote: They have the intent (Alan Eliasen has the intent) of implementing 'intervals' which match fuzzy values where you know an approximate extent of the value, but not the value itself. E.g (.5 ... .75) * (.5 ... .8) == (.25 ... .6) Given that frink values can have units like gallons or pounds, and they intend on tracking accuracy inside of intervals, with different distributions, this is especially powerful. Is there the intent to have intervals in perl6, or would it be better just to port frink to parrot and be done with it? I think this is best left up to frink or CPAN (or a frink interface on CPAN). Interval arithmetic looks nice at first, but can get subtle when dealing with powers, and insane when dealing with functions like sin. Luke
Re: Perl development server
Hi Well... I promise not to push much the server. Although I think I will manage to get ghc and all those things working soon, I would like an account too, if possible. User name, ambs Also, onion as a machine name is a good name. Domm++ Alberto wolverian wrote: On Mon, May 23, 2005 at 05:18:45PM +0200, Juerd wrote: Hi, Hello :) because I see some people struggle to get things like GHC working, and then to get make and a compiler working, and because some people have limited bandwidth which makes big svn updates a less pleasant experience, and for other reasons, I decided to have my company, Convolution, sponsor a shell server. Lots of thanks for this. A dedicated server will make my life easier, at least. If you want access, please let me know. I will send you a temporary password by e-mail, that I expect you to change the first time you get the chance. I'd like a login, username wolverian. Thanks! Please let me know which software you want installed. If it's in Debian and doesn't conflict with other software, you can have it (but no X or openoffice, or the like). If it's not in Debian, you'll have to compile it yourself. All I need are the basics - vim, scp. I think those are installed by default, anyway. A perl-enabled version of vim would be nice. -- Alberto Simões - Departamento de Informática - Universidade do Minho Campus de Gualtar - 4710-057 Braga - Portugal
Re: Perl development server
On Mon, May 23, 2005 at 12:00:14PM -0400, Stevan Little wrote: On May 23, 2005, at 11:25 AM, Juerd wrote: dev.pugscode.org seems indicated ... Sorry, but 'dev' isn't cute enough :). And it's going to be something.perl6.nl, probably. I don't mind aliases, though, but they better be CNAMEs. Juerd, why am I getting everyone's responses, but not your original messages? lambdacamels.perl6.nl? That's catchy, and we could all remember it. Or in keeping with the Tolkien theme, there's always: silmaril.perl6.nl valinor.perl6.nl or some such. -kolibrie
Re: Perl development server
On Mon, May 23, 2005 at 06:51:31PM +0200, Juerd wrote: Nathan Gray skribis 2005-05-23 12:50 (-0400): Sorry, but 'dev' isn't cute enough :). And it's going to be something.perl6.nl, probably. I don't mind aliases, though, but they better be CNAMEs. Juerd, why am I getting everyone's responses, but not your original messages? I have no idea. I'm sending these messages to the two mailing lists, and from there on, I can't track where they're going (or not) Got this one. Weird. -kolibrie
Re: Argument Type Checking
On May 19, 2005, at 10:56 PM, Luke Palmer wrote: In general, you should probably be declaring your parameters with uppercase types, [...] Luke If so, wouldn't it make sense that 'int' is the boxed type (one less keystroke) and 'Int' is the special case? Optimize for the common case, and all that. Of course, it would go against the consensus of other languages. --Dks
Re: Perl development server
I've been advised to make sure I get the full names of users, not just their nicknames and e-mail addresses, for juridical purposes. Although this can be a rather sensitive subject for some, I've chosen to follow the advice and require that users make their full name known. If you don't have a last|family name, get one ;) Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html
mod/div (was: reduce metaoperator on an empty list)
[EMAIL PROTECTED] wrote: There are actuall two usefull definition for %. The first which Ada calls 'mod' always returns a value 0=XN and yes it has no working value that is an identity. The other which Ada calls 'rem' defined as follows: Signed integer division and remainder are defined by the relation: A = (A/B)*B + (A rem B) where (A rem B) has the sign of A and an absolute value less than the absolute value of B. Signed integer division satisfies the identity: (-A)/B = -(A/B) = A/(-B) It does have a right side identity of +INF. This is the truncating div-dominant definition of modulo. The eulerian definition is mod-dominant and nicely handles non-integer values. E.g. 3.2 == 1.5 * 2 + 0.2 -+-- 3.2 / 1.5 == 2 + 0.2 / 1.5 == 2 + 1/15 | == 2 + 0.1333... +-- 3.2 % 1.5 == 0.2 Note that -3.2 == -4 + 0.8 == -4.5 + 1.3 == ... -3.2 / 1.5 == -3 + 1.3 / 1.5 == -3 + 0.8666... == -2.1333 -3.2 % 1.5 == 1.3 With integers: 8 / 3 == (2 + 2/3) == 2 8 / (-3) == -(2 + 2/3) == -2 (-8) / 3 == -(3 - 1/3) == -3 # this might surprise some people ;) (-8) / (-3) == (3 - 1/3) == 3 8 % (-3) == 8 % 3 == 2 (-8) % (-3) == (-8) % 3 == 1 # this as well, but it's just -3 * 3 + 1 Real valued division can be considered as % 0, that is infinite precision. While integer arithmetic is % 1. I.e. int $x == $x - $x % 1. floor $x == $x - $x % 1# -1.2 - (-1.2) % 1 == -1.2 - 0.8 == -2 ceil $x == 1 + floor $x round $x == floor( $x + 0.5 ) trunc $x == $x 0 ?? ceil $x :: floor $x To @Larry: how are mod and div defined in Perl6? -- TSa (Thomas Sandlaß)
Re: mod/div (was: reduce metaoperator on an empty list)
I would really like to see ($x div $y) be (floor($x/$y)) and ($x mod $y) be ($x - $x div $y). If the divisor is positive the modulus should be positive, no matter what the sign of the dividend. Avoids lots of special case code across 0 boundaries. On 2005-05-23 18:49, TSa (Thomas Sandlaß) [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: There are actuall two usefull definition for %. The first which Ada calls 'mod' always returns a value 0=XN and yes it has no working value that is an identity. The other which Ada calls 'rem' defined as follows: Signed integer division and remainder are defined by the relation: A = (A/B)*B + (A rem B) where (A rem B) has the sign of A and an absolute value less than the absolute value of B. Signed integer division satisfies the identity: (-A)/B = -(A/B) = A/(-B) It does have a right side identity of +INF. This is the truncating div-dominant definition of modulo. The eulerian definition is mod-dominant and nicely handles non-integer values. E.g. 3.2 == 1.5 * 2 + 0.2 -+-- 3.2 / 1.5 == 2 + 0.2 / 1.5 == 2 + 1/15 | == 2 + 0.1333... +-- 3.2 % 1.5 == 0.2 Note that -3.2 == -4 + 0.8 == -4.5 + 1.3 == ... -3.2 / 1.5 == -3 + 1.3 / 1.5 == -3 + 0.8666... == -2.1333 -3.2 % 1.5 == 1.3 With integers: 8 / 3 == (2 + 2/3) == 2 8 / (-3) == -(2 + 2/3) == -2 (-8) / 3 == -(3 - 1/3) == -3 # this might surprise some people ;) (-8) / (-3) == (3 - 1/3) == 3 8 % (-3) == 8 % 3 == 2 (-8) % (-3) == (-8) % 3 == 1 # this as well, but it's just -3 * 3 + 1 Real valued division can be considered as % 0, that is infinite precision. While integer arithmetic is % 1. I.e. int $x == $x - $x % 1. floor $x == $x - $x % 1# -1.2 - (-1.2) % 1 == -1.2 - 0.8 == -2 ceil $x == 1 + floor $x round $x == floor( $x + 0.5 ) trunc $x == $x 0 ?? ceil $x :: floor $x To @Larry: how are mod and div defined in Perl6?
Re: Argument Type Checking
David Storrs [EMAIL PROTECTED] wrote: If so, wouldn't it make sense that 'int' is the boxed type (one less keystroke) and 'Int' is the special case? Optimize for the common case, and all that. Think of it as being like module names--all-lowercase modules are special (pragmata), while intercaps modules are normal (modules and classes). Similarly, all-lowercase types are special (unboxed), while intercaps types are normal (boxed classes). -- Brent 'Dax' Royal-Gordon [EMAIL PROTECTED] Perl and Parrot hacker