dsmith
2021-5-12 17:20:10
@dsmith has joined the channel
notjack
2021-5-12 18:59:01
might I suggest sequence-index-of
instead?
jestarray
2021-5-12 22:24:28
what is the shortest syntactical way to take the car of an element and stick it to the end? (define x (list 1 2 3))
(flatten (cons (cdr x) 1)) ; (list 2 3 1)
is what is im doing atm
kellysmith12.21
2021-5-12 22:30:31
(define (car-to-end lst)
(foldr cons (list (car lst)) (cdr lst)))
kellysmith12.21
2021-5-12 22:33:07
Actually, this might be clearer: (define (car-to-end lst)
(append (cdr lst) (list (car lst))))
jestarray
2021-5-12 22:34:14
thanks :9
kellysmith12.21
2021-5-12 22:36:50
Note: that definition will not work on empty lists.
jestarray
2021-5-12 22:37:17
another question , (read-json) returns an immutable hash, how would i make this into a mutable hash?
kellysmith12.21
2021-5-12 22:38:03
jestarray
2021-5-12 22:38:54
ahhhhh
jestarray
2021-5-12 22:39:24
was scanning for immutable->mutable-hash
lol. thanks again :kissing_heart:
sorawee
2021-5-13 01:38:16
I hope string-index
will work with two arbitrary strings. E.g., (string-index "abcdef" "de")