* [9front] rc fn weirdness
@ 2021-09-17 16:55 Sigrid Solveig Haflínudóttir
2021-09-18 2:48 ` Alex Musolino
0 siblings, 1 reply; 3+ messages in thread
From: Sigrid Solveig Haflínudóttir @ 2021-09-17 16:55 UTC (permalink / raw)
To: 9front
; fn a/b { echo 123 }
; a/b
rc: can't open /env/fn#a/b: '/env/fn#a' file does not exist
123
; a/b
123
; du -a /env/ | grep '#a'
1 '/env//fn#acid'
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [9front] rc fn weirdness
2021-09-17 16:55 [9front] rc fn weirdness Sigrid Solveig Haflínudóttir
@ 2021-09-18 2:48 ` Alex Musolino
2021-09-18 3:24 ` ori
0 siblings, 1 reply; 3+ messages in thread
From: Alex Musolino @ 2021-09-18 2:48 UTC (permalink / raw)
To: 9front
Quoth Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>:
> ; fn a/b { echo 123 }
> ; a/b
> rc: can't open /env/fn#a/b: '/env/fn#a' file does not exist
> 123
> ; a/b
> 123
> ; du -a /env/ | grep '#a'
> 1 '/env//fn#acid'
Same thing for variables:
; a/b/c = 333
; echo $'a/b/c'
rc: can't open /env/a/b/c: '/env/a' not a directory
333
; echo $'a/b/c'
333
;
I guess it's not that weird. It's trying to create a file in a
subdirectory of /env which doesn't exist. As for why it only
complains about this once, look at /sys/src/cmd/rc/plan9.c:/^addenv;
it sets v->[fn]changed = 0 before trying to create the file under
/env.
The easiest thing to do would just be to disallow '/' in function or
variable names.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-18 7:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17 16:55 [9front] rc fn weirdness Sigrid Solveig Haflínudóttir
2021-09-18 2:48 ` Alex Musolino
2021-09-18 3:24 ` ori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).