Newsgroups: perl.perl6.language
From: r...@rodadams.net (Rod Adams)
Date: Tue, 15 Mar 2005 01:12:31 -0600
Local: Tues, Mar 15 2005 2:12 am
Subject: Exists and Delete
How am I supposed to define a signature that says "A scalar that refers
to a hash or array element, but do not evaluate or autovivify the element"? Or are these two are now strictly methods without functional forms? -- Rod Adams You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: perl.perl6.language
From: Thomas.Sandl...@orthogon.com (Thomas Sandlaß)
Date: Tue, 15 Mar 2005 18:57:02 +0100
Local: Tues, Mar 15 2005 12:57 pm
Subject: Re: Exists and Delete
Rod Adams wrote: I'll make a guess: Ref of Int of Array. > How am I supposed to define a signature that says "A scalar that refers > to a hash or array element, but do not evaluate or autovivify the element"? This assumes Int has a polymorphic subtype that allows pointing into arrays. But unfortunately you need two values to describe the reference: the index and the array. So it should be more like a pair: Ref of Pair[Int,Array]. my @array; $iref = "blahh"; > Or are these two are now strictly methods without functional forms? Sorry I don't know what you are asking for. What is then a method with functional form? Do you mean that the entries in an array are off-limits to the outside and can be accessed only by the subscripting methods? Regards, You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: perl.perl6.language
From: r...@rodadams.net (Rod Adams)
Date: Tue, 15 Mar 2005 12:44:06 -0600
Local: Tues, Mar 15 2005 1:44 pm
Subject: Re: Exists and Delete
What I'm asking is if we are going to continue allowing:
delete %x<foo>; or make it where you instead have to say %x.delete('foo'); -- Rod Adams You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: perl.perl6.language
From: ju...@convolution.nl (Juerd)
Date: Tue, 15 Mar 2005 19:47:58 +0100
Local: Tues, Mar 15 2005 1:47 pm
Subject: Re: Exists and Delete
Rod Adams skribis 2005-03-15 12:44 (-0600):
> %x.delete('foo'); Would renaming exists to has or hasa be a good idea, if it does indeed > if %x.exists('foo') { ... } exist only in method form? Juerd You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: perl.perl6.language
From: la...@wall.org (Larry Wall)
Date: Tue, 15 Mar 2005 11:20:54 -0800
Local: Tues, Mar 15 2005 2:20 pm
Subject: Re: Exists and Delete
On Tue, Mar 15, 2005 at 07:47:58PM +0100, Juerd wrote: : Rod Adams skribis 2005-03-15 12:44 (-0600): : > %x.delete('foo'); : > if %x.exists('foo') { ... } : : Would renaming exists to has or hasa be a good idea, if it does indeed : exist only in method form? I'd think that would be asking if the array has an *attribute* of Larry You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: perl.perl6.language
From: ju...@convolution.nl (Juerd)
Date: Tue, 15 Mar 2005 20:22:37 +0100
Local: Tues, Mar 15 2005 2:22 pm
Subject: Re: Exists and Delete
Larry Wall skribis 2005-03-15 11:20 (-0800):
> On Tue, Mar 15, 2005 at 07:47:58PM +0100, Juerd wrote: That makes sense. I think %x ~~ 'foo' will be used more than > : Rod Adams skribis 2005-03-15 12:44 (-0600): > : > %x.delete('foo'); > : > if %x.exists('foo') { ... } > : Would renaming exists to has or hasa be a good idea, if it does indeed > : exist only in method form? > I'd think that would be asking if the array has an *attribute* of > that name. Perl 6 objects aren't hashes... %x.exists('foo') anyway. Juerd You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: perl.perl6.language
From: la...@wall.org (Larry Wall)
Date: Tue, 15 Mar 2005 10:58:20 -0800
Local: Tues, Mar 15 2005 1:58 pm
Subject: Re: Exists and Delete
On Tue, Mar 15, 2005 at 12:44:06PM -0600, Rod Adams wrote: : What I'm asking is if we are going to continue allowing: : : delete %x<foo>; : if exists %x<foo> { ... } : : or make it where you instead have to say : : %x.delete('foo'); : if %x.exists('foo') { ... } They can always just be macros that translate the unary form to the Larry You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2009 Google |