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: 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: 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 #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