Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-07 Thread Solomon Foster
1389781327557747838772170381060813469985856815104 1). That's only accurate to 10**83. Which is to say, it's as accurate as a double gets -- 16-17 digits. (BTW, that is a legal Rat.) I admit don't really know what to do with this. -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-04 Thread Solomon Foster
should have is a quick and easy way to convert from Num to FatRat with minimal loss of precision. I believe right now the default Num -> FatRat conversion also uses 1e-6 as an epsilon, which seems wrong to me. -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: Rationalizing numeric types

2015-06-22 Thread Solomon Foster
ndental constants like pi and e, with trig and > log/exponentiation functions using them. Then Perl 6 could get this famous > relationship *exactly right*: > > say 1 + e ** (pi * i) > > ... though I suspect it really does take a symbolic math package to get > all combinations of

Re: Grammars and biological data formats

2014-08-13 Thread Solomon Foster
> > Grammar.parse($file.slurp) > > since Grammar.parse() works on a Str, not a IO::Handle or Buf. Or am I > misunderstanding how this could be accomplished? My understanding is it is intended that parsing can work on Cats (hypothetical lazy strings) but this hasn't bee

Re: Are set operations needed?

2013-07-18 Thread Solomon Foster
Full list of "Texas" (ie ASCII) set operators: union: (|) intersection: (&) set difference: (-) symmetric difference: (^) subset: (<=) proper subset: (<) superset: (>=) proper superset: (>) is an element of: (elem) is contained by: (cont) On Thu, Jul 18, 2013 at 11:45

Re: Are set operations needed?

2013-07-18 Thread Solomon Foster
ed in Perl6? No implementation of the perl6 set >>> specification yet exists (AFAIK). >> >> >> You are wrong. Both rakudo and niecza implement significant subsets of the >> set specification. >> >> Cheers, >> Moritz > > -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: [perl6/specs] 5277fe: Add expmod and is-prime as built-ins in Int

2012-09-24 Thread Solomon Foster
s implementation is that it always tests against the first 256 primes, so it also takes advantage of this in correctness, if possibly not in speed. -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: How to make a new operator.

2012-03-21 Thread Solomon Foster
ples: 2, 5 ... 11 # smartmatch is true when you hit 11 2, 5 ... True # stop right away 2, 5 ... False # never stop 2, 5 ... * # shorter way of saying never stop 2, 1, 1/2 ... Num # stop when the number switches from a Rat to a Num 'a' ... /f/ # stop when the regular expression matches -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: [perl #105272] [RESOLVED] [BUG] round behaving badly

2011-12-06 Thread Solomon Foster
ics, please create a new ticket. > > https://rt.perl.org:443/rt3/Ticket/Display.html?id=105272 > 23.542323.round still hangs in p6eval as of 30 seconds ago. -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: [perl #83356] [BUG] exporting infix:<+> fails from simple class

2011-02-05 Thread Solomon Foster
On Fri, Feb 4, 2011 at 7:29 AM, Moritz Lenz via RT wrote: > Am 04.02.2011 05:04, schrieb Solomon Foster (via RT): >> # New Ticket Created by  Solomon Foster >> # Please include the string:  [perl #83356] >> # in the subject line of all future correspondence about

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-08 Thread Solomon Foster
ot;second", etc.  So what should happen if I try to apply a > hyperoperator with a Bag or Set on one side? Well, hyperoperators work fine on Hashes, they operate on the values, paired up by key if needed. (That is, %hash>>++ doesn't care about the keys, %hash1 >>+<<

Re: Large integers, ** and Int

2010-08-18 Thread Solomon Foster
x27;infix:<+>' at line 6752:CORE.setting >>   in main program body at line 1 >> >> So it looks like it's just totally unwilling to try to use that inline:<+> >> that I've defined, and instead is dead-set on trying to convert my BigTest >> to a Num

Re: Suggested magic for "a" .. "b"

2010-07-20 Thread Solomon Foster
On Tue, Jul 20, 2010 at 10:00 PM, Jon Lang wrote: > Solomon Foster wrote: >> Ranges haven't been intended to be the "right way" to construct basic >> loops for some time now.  That's what the "..." series operator is >> for. >> >>  

Re: Suggested magic for "a" .. "b"

2010-07-20 Thread Solomon Foster
in the series operator. Range is not supposed to do any of that stuff other than the most basic forward sequence. -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: r31050 -[S03] refine hyper dwimminess to be more like APL, with modular semantics

2010-06-02 Thread Solomon Foster
for example) isn't actually supposed to work, is it? Certainly doesn't work in Rakudo and I've never seen a spectest written like that... -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Announce: Rakudo Perl 6 development release #29 ("Erlangen")

2010-05-20 Thread Solomon Foster
thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Solomon Foster, Moritz Lenz, Jonathan Worthington, Martin Berends, chromati

Re: Something about the cascade calling of sort() in rakudo.

2010-03-23 Thread Solomon Foster
-1, 1, -2, 2, -3, 3, -4, 4, -5, 5, 6, 7, 8, 9, 10)␤» That is, adding a .Seq between the two sorts clears up the problem. That is admittedly a hack, but it is a simple one. Thanks for reporting the problem! -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: One-pass parsing and forward type references

2010-02-01 Thread Solomon Foster
d). And just to finish it off... are you allowed to do 'class B { ... }' even after "declaring the real B"? -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: Custom errors on subsets?

2010-01-05 Thread Solomon Foster
On Tue, Jan 5, 2010 at 11:36 AM, Ovid wrote: > --- On Tue, 5/1/10, Solomon Foster wrote: > >> From: Solomon Foster > >> > Is this a bug or just documented behavior that I don't >> know about? >> >> fail just returns an uncalled exception.  What

Re: Custom errors on subsets?

2010-01-05 Thread Solomon Foster
   say "before"; >    foo('no_such_file'); >    say "after"; > > Output: > >    Houston, we have a filename: /Users/ovid/bin/perl6 >    before >    after > > Is this a bug or just documented behavior that I don't know about? fail just returns an uncalled exception. What does that do in a where block? -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: r29111 - docs/Perl6/Spec

2009-11-18 Thread Solomon Foster
eing > efficient with common pathological cases such as very large or very small > rationals with a small amount of precision, such as the above, as well as > for exactly reflecting the concept of a radix-agnostic floating-point > number. What's your objection to FatRat.new(45207196, 11 ** 37)? -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: How does List.map: { .say } work?

2009-11-02 Thread Solomon Foster
On Mon, Nov 2, 2009 at 2:03 PM, Solomon Foster wrote: > On Mon, Nov 2, 2009 at 10:21 AM, Carl Mäsak wrote: >> Solomon (>), Moritz (>>): >>>> the current spec doesn't allow immutable containers to call .map with a >>>> block that implicitly uses $_

Re: How does List.map: { .say } work?

2009-11-02 Thread Solomon Foster
il() on detecting a >>> modification? Somehow this approach seems very backward to me... >> >> Is there a reason $_ is readonly isn't a possible solution? > > For one thing, then you couldn't do this: > > my @a = 1, 2, 3; > for @a { >  ++$_; > } I mean

Re: How does List.map: { .say } work?

2009-11-02 Thread Solomon Foster
rary variable be created that >  can be changed, without any effect? or should it fail() on detecting a > modification? Somehow this approach seems very backward to me... Is there a reason $_ is readonly isn't a possible solution? -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: [perl #69076] [BUG] [LHF] Strange tricks with Num.sin

2009-10-29 Thread Solomon Foster
n (/tmp/DZhXZHeJmV:2)␤» > > Since The Big Complex/Trig Refactor all these produce the same output. > > colomon, are you comfortable with our test coverage? If yes we can close > this. Yes, I think there are enough trig tests these days. :) Thanks for cleaning these up. -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: [perl #69076] [BUG] Strange tricks with Num.sin

2009-09-26 Thread Solomon Foster
mplex problem on #perl6 yesterday? No rush whatsoever, I think your PGE stuff is more important, and besides, I could use a few days where working on Rakudo trig functions isn't stealing time from my $work. (Rakudo is much more -Ofun than my $work is at the moment.) -- Solomon Foster: co

Re: [perl #69194] rakudo 2009-08 and when with lists

2009-09-19 Thread Solomon Foster
1.5 { when Range.new(from => 1, to => 2, by => 1/3) { say 'between one and two' }; say 'not'; }; p6eval rakudo 4b141a: OUTPUT«between one and two␤» makes me very leery. I know :by isn't actually implemented yet, but what should it do here when it is? -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com

Re: Struggles with Trig

2009-09-08 Thread Solomon Foster
he iceberg.) > > Since the visible tip of the iceberg is usually about 1/9 th of the > volume, I'm looking forward to another 8k tests ;-) Seriously, I wouldn't be surprised if it ends up being something like that. > I don't worry if that skews any spectest sta

Re: [perl #68898] AutoReply: [PATCH] Swap meanings of Int / Int and div

2009-09-01 Thread Solomon Foster
drastically improved from the first one I sent out. -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com 0001-Fix-Rat.perl-to-return-N-M-rather-than-Rat.new-N.patch Description: Binary data 0002-Switch-GCD-routine-to-use-instead-of-for-a-vast.patch Description

Re: [perl #68898] AutoReply: [PATCH] Swap meanings of Int / Int and div

2009-09-01 Thread Solomon Foster
the code for the old Int / Int, but S03 suggests the > edge cases should be a bit different. > 2. Something is broken in temporal.t, presumably indicating something > is broken in Temporal.pm. > 3. Rat.perl is probably a bit silly, considering that "N/M" should work. > > -

[perl #62178] gather/take does not work with loop, either

2009-08-08 Thread Solomon Foster
rakudo: my @a = gather loop (my $i = 1; $i < 10; $i++) { take $i }; @a.perl.say; p6eval: rakudo 7717c4: OUTPUT«[10, 10, 10, 10, 10, 10, 10, 10, 10]␤» -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com