On Tue, Jul 11, 2017 at 12:56 AM, Alex Knauth wrote:
>
> You can do this with the Generic Bind package [1].
Oh, this is very nice. Thank you. -J
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this
Nice, thank you!
On Mon, Jul 10, 2017 at 10:56 PM, Alex Knauth wrote:
>
> On Jul 11, 2017, at 12:38 AM, Nadeem Abdul Hamid wrote:
>
> ... though a syntactic solution combining for and match would probably
>> be better.
>>
>
> Yes, please!...
> Look, python
> On Jul 11, 2017, at 12:38 AM, Nadeem Abdul Hamid wrote:
>
> ... though a syntactic solution combining for and match would probably
> be better.
>
> Yes, please!...
> Look, python can do it:
>
> >>> [(x, z) for (x, y, z) in [(1, 2, 3), (4, 5, 6), (7, 8, 9), ('a', 'b',
> >>>
>
> ... though a syntactic solution combining for and match would probably
> be better.
>
Yes, please!...
Look, python can do it:
>>> [(x, z) for (x, y, z) in [(1, 2, 3), (4, 5, 6), (7, 8, 9), ('a', 'b',
'c')]]
[(1, 3), (4, 6), (7, 9), ('a', 'c')]
:-)
--
You received this message because you
On Tue, Jul 11, 2017 at 12:28 AM, Jon Zeppieri wrote:
>
> As far as I know, there's nothing built-in that does this, but it's
> not hard to build:
>
... though a syntactic solution combining for and match would probably
be better.
--
You received this message because you
On Tue, Jul 11, 2017 at 12:16 AM, Nadeem Abdul Hamid wrote:
> I'm looking for a general solution. Basically, I thought binding multiple
> id's would have achieved what this does:
>
>> (for/list ([t '((1 2 3) (4 5 6) (7 8 9) (a b c))])
> (match-define (list x y z) t)
>
I'm looking for a general solution. Basically, I thought binding multiple
id's would have achieved what this does:
> (for/list ([t '((1 2 3) (4 5 6) (7 8 9) (a b c))])
(match-define (list x y z) t)
(list x z))
'((1 3) (4 6) (7 9) (a c))
The way the documentation for `for` is worded [3],
On Mon, Jul 10, 2017 at 11:40 PM, Nadeem Abdul Hamid wrote:
> Given a list of pairs, I'm trying to iterate through the list and bind the
> first and second elements of each pair to x and y, respectively, in each
> iteration.
>
> For example, hash sets are a multiple-valued
Given a list of pairs, I'm trying to iterate through the list and bind the
first and second elements of each pair to x and y, respectively, in each
iteration.
For example, hash sets are a multiple-valued sequence[1], so this:
(for/list ([(x y) #hash((1 . 2) (3 . 4))]) x)
produces:
(list 1
On Mon, Jul 10, 2017 at 11:02 PM, Nadeem Abdul Hamid wrote:
> How come this:
>(for/list ([(x y) (in-parallel '(1 2) '(3 4))]) x)
> produces
> '(1 2)
> instead of
> '(1 3)
> ?
You're creating a list of the x values. In the first iteration x is 1,
and in the second it's 2.
How come this:
(for/list ([(x y) (in-parallel '(1 2) '(3 4))]) x)
produces
'(1 2)
instead of
'(1 3)
?
Whereas,
(sequence-ref (in-parallel '(1 2) '(3 4)) 0)
produces
1
3
as I would expect, but am I doing something wrong with for/list?
In general, how might one convert a list of
My general idea for this system is to write a small kernel that would boot and
start a REPL, but now that I'm thinking about it I'd need to do some finagling
to get Racket itself working on this new system --- not to mention learning ARM
ASM if I'm going to implement this on a Raspberry Pi. By
12 matches
Mail list logo