[Nix-dev] [nix language] strings that have paths/derivations embedded

2012-10-09 Thread Mathijs Kwik
Hi all, I'm trying to escape a string using lib.escape. My goals is to turn a string into a regex for grep that matches just that string, so I need to escape regex special characters like . and *. All seems to works fine, but once the input string contains a derivation path, it stops working. If

Re: [Nix-dev] [nix language] strings that have paths/derivations embedded

2012-10-09 Thread Marc Weber
Excerpts from Mathijs Kwik's message of Tue Oct 09 12:09:33 +0200 2012: > I found the scary-sounding function "unsafeDiscardStringContext", > which seems to work around this problem. > Can someone please shed some light on what's going on (or nix > string/context handling in general) and if it that

Re: [Nix-dev] [nix language] strings that have paths/derivations embedded

2012-10-09 Thread Mathijs Kwik
On Tue, Oct 9, 2012 at 12:18 PM, Marc Weber wrote: > Excerpts from Mathijs Kwik's message of Tue Oct 09 12:09:33 +0200 2012: >> I found the scary-sounding function "unsafeDiscardStringContext", >> which seems to work around this problem. >> Can someone please shed some light on what's going on (or

Re: [Nix-dev] [nix language] strings that have paths/derivations embedded

2012-10-09 Thread Eelco Dolstra
Hi, On 09/10/12 06:09, Mathijs Kwik wrote: > I'm trying to escape a string using lib.escape. > My goals is to turn a string into a regex for grep that matches just > that string, so I need to escape regex special characters like . and > *. I just want to caution that doing this kind of string ma

Re: [Nix-dev] [nix language] strings that have paths/derivations embedded

2012-10-09 Thread Mathijs Kwik
On Tue, Oct 9, 2012 at 4:08 PM, Eelco Dolstra wrote: > Hi, > > On 09/10/12 06:09, Mathijs Kwik wrote: > >> I'm trying to escape a string using lib.escape. >> My goals is to turn a string into a regex for grep that matches just >> that string, so I need to escape regex special characters like . and