Using patterns for mutating data structures? #196
Replies: 2 comments
-
Hi! |
Beta Was this translation helpful? Give feedback.
-
That's perfect, thanks! Now I can use functions to contain the algorthms for doing lookups and modifications, so that my main program just needs to bind some variables, call What parts of the pattern are evaluated lazily? I'm guessing that the data for any global patterns is read in when the script first gets evaluated, but that data in pattern views inside functions is only read when the function is executed? The reason is that if I'm accessing the disk directly, then it can take up to a minute. Could I do something like this?
Then the application can run the script to scan just the filesystem metadata, and when it's ready it calls |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello ---
I have a project, FluxEngine, which is software for doing flux-level reads of floppy disks using a flux reader like a Greaseweazle. One feature I've been adding is the ability to read and write files from and to the filesystem directly, either working on images, flux files, or on a disk with real hardware.
So far I've been writing the filesystem plugins myself (or, where possible, using external libraries). For example, here's the cpmfs plugin: https://github.com/davidgiven/fluxengine/blob/master/lib/vfs/cpmfs.cc But the pattern language here looks like it'd be a perfect fit for a rather more abstract and flexible way of accessing filesystem data. The way I'd do it is to have each pattern producing a structure in a standardised schema which the main FluxEngine software can query in order to access the files.
However, FluxEngine also supports writing files. Is there any way that the pattern language can help here? I'm not expecting the to figure out the algorithms for, e.g., allocating blocks, but even being able to use the generated structure for accessing structures on the disk would be a big help.
I appreciate if this is out of scope for the pattern language, but I'm always looking for things which will make my life easier!
Beta Was this translation helpful? Give feedback.
All reactions