Groups
Groups
Sign in
Groups
Groups
Lisphp
Conversations
About
Send feedback
Help
Lisphp equivalent of $foo['bar']['baz'] = 'A';
13 views
Skip to first unread message
Jonathan Aquino
unread,
Mar 4, 2014, 1:45:01 PM
3/4/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lis...@googlegroups.com
I was wondering, what is the Lisphp equivalent of doing:
$foo['bar']['baz'] = 'A';
$foo['bar']['qux'] = 'B';
To do this, I implemented by own array-set function, but using it is rather ugly:
(setf! foo (array-set foo 'bar' 'baz' 'A'))
(setf! foo (array-set foo 'bar' 'qux' 'B'))
Jonathan
Jonathan Aquino
unread,
Mar 5, 2014, 8:14:49 PM
3/5/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lis...@googlegroups.com
Oh, actually if I use array_replace_recursive (defined as "arr"), I can do this:
(arr foo
(hash 'bar' (hash 'baz' 'A'
'qux' 'B')))
which is better.
Reply all
Reply to author
Forward
0 new messages