IWETHEY v. 0.3.0
|
TODO
1,095 registered users | 1
active user
| 0 LpH |
Statistics
Login
|
Create New User
Welcome to IWETHEY!
IWETHEY Home
/
IWETHEY Board
/
Theory and Practice of Programming Forum
/
Sure beats the old way
Post #197,497
by
FuManChu
3/7/05 1:02:55 PM
Reply
Sure beats the old way
>>> stuff = (1,2,3,4,3,4,5,6,45,6,7,8,9,5,6)
>>> dict.fromkeys(stuff).keys()
[1, 2, 3, 4, 5, 6, 7, 8, 9, 45]
Sets are available in 2.3, by the way, just as a library module instead of a builtin. But you knew that. But not everyone does. ;)
Perl array question
- (
pwhysall
)
- (20)
- March 7, 2005, 09:51:52 AM EST
if (grep {$_ eq $thing} @stuff) {...}
- (
ben_tilly
)
- (11)
- March 7, 2005, 11:08:08 AM EST
Thanks
- (
pwhysall
)
- March 7, 2005, 12:04:52 PM EST
grep is cool...
- (
admin
)
- (5)
- March 7, 2005, 12:08:15 PM EST
Sure beats the old way
- (
FuManChu
)
- March 7, 2005, 01:02:55 PM EST
my %seen; # Not $seen = ();
- (
ben_tilly
)
- (3)
- March 7, 2005, 02:53:31 PM EST
*shrug* I got that from the Perl cookbook.
- (
admin
)
- (2)
- March 7, 2005, 04:22:17 PM EST
Yes it does work. Once.
- (
ben_tilly
)
- (1)
- March 7, 2005, 04:28:56 PM EST
Nope, you're right.
- (
admin
)
- March 7, 2005, 04:38:02 PM EST
Why I Needed Something Other Than "grep"
- (
pwhysall
)
- (3)
- March 8, 2005, 03:08:44 AM EST
You may only need one loop...
- (
ben_tilly
)
- (1)
- March 8, 2005, 09:31:10 AM EST
And there's the rub.
- (
pwhysall
)
- March 8, 2005, 12:20:43 PM EST
Post the code
- (
broomberg
)
- March 8, 2005, 07:32:37 PM EST
Re: Perl array question
- (
admin
)
- (7)
- March 7, 2005, 11:14:54 AM EST
woooo....
- (
folkert
)
- March 7, 2005, 11:22:44 AM EST
"other"? - There's another?
-NT
- (
broomberg
)
- (5)
- March 7, 2005, 07:16:12 PM EST
Yes. Ruby.
-NT
- (
ben_tilly
)
- (4)
- March 7, 2005, 07:40:56 PM EST
No, that's the *other* other one.
-NT
- (
admin
)
- (3)
- March 7, 2005, 07:42:42 PM EST
You like TCL??
-NT
- (
ben_tilly
)
- (2)
- March 7, 2005, 07:59:55 PM EST
Not without a ring, Mister.
-NT
- (
admin
)
- (1)
- March 7, 2005, 08:00:21 PM EST
You prefer to take DOS to bat?
-NT
- (
ben_tilly
)
- March 7, 2005, 08:28:34 PM EST
i
we
they
.org
I don't think these were sliced from anything.
39 ms