Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-12 Thread Brian Duggan
On Saturday, October 10, William Michels via perl6-users wrote: > I can point to the (functional) R-programming language to show what happens > there. When manipulating "array-like" (i.e. vector) objects in R, you can > do nested function calls, or sequential (piped) function calls, and still > ge

Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-12 Thread Aureliano Guedes
On Mon, Oct 12, 2020 at 10:03 AM Brian Duggan wrote: > On Saturday, October 10, William Michels via perl6-users wrote: > > I can point to the (functional) R-programming language to show what > happens > > there. When manipulating "array-like" (i.e. vector) objects in R, you can > > do nested func

Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-12 Thread yary
These behave like overwriting > List.^find_method('split').wrap: { $^a.map: *.split($^b) } > List.^find_method('sin').wrap: *.map: *.sin; > but they don't have to, since Aureliano started with "wrap" they can be actual wrappers: sub map-over-arg(\A) {my &nextone=nextcallee; A.map:{nextone $_}} L

Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-12 Thread Larry Wall
On Mon, Oct 12, 2020 at 01:14:09PM -0300, Aureliano Guedes wrote: : > This seems pretty convenient and intuitive. At least, it is possible : > to mimic that behavior in Raku: : > : > List.^find_method('split').wrap: { $^a.map: *.split($^b) } : > List.^find_method('sin').wrap: *.map

Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-12 Thread William Michels via perl6-users
Thank you, Joe, for taking the time to write such a cogent reply. And thanks to Tobias and everyone else who has taken the time to reply to my questions. On Sat, Oct 10, 2020 at 3:38 PM Joseph Brenner wrote: > William Michels wrote: > > >I actually wondered where the different programming paradi

Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-12 Thread William Michels via perl6-users
On Mon, Oct 12, 2020 at 6:02 AM Brian Duggan wrote: > On Saturday, October 10, William Michels via perl6-users wrote: > > I can point to the (functional) R-programming language to show what > happens > > there. When manipulating "array-like" (i.e. vector) objects in R, you can > > do nested funct

Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-12 Thread William Michels via perl6-users
Thank you Timo for the favor of a reply! On Sat, Oct 10, 2020 at 3:35 PM Timo Paulssen wrote: > On 10/10/2020 23:21, William Michels via perl6-users wrote: > > So I guess the first question I have is whether the 'auto-joining' of > > array elements is specc'ed or not. > > > > What you seem to be

Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-12 Thread William Michels via perl6-users
On Sat, Oct 10, 2020 at 4:49 PM Tobias Boege wrote: > On Sun, 11 Oct 2020, Tobias Boege wrote: > > On Sat, 10 Oct 2020, William Michels via perl6-users wrote: > > > then proceed to process the function call. As it is my understanding > that > > > Raku incorporates a lot of different programming p

Re: Language Design: 'special casing' of split()? (i.e. .split performs concomitant .join? )

2020-10-12 Thread yary
Here's another way of phrasing these answers- Some routines like "join" operate on strings, and thus coerce their argument to a string. Some routines like "sin" operate on numbers, and thus coerce their argument to a number. Each class defines how it coerces to Str or Num, regardless of what is