Suggestion: Rename "Preprocessor" to "search functions"

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Suggestion: Rename "Preprocessor" to "search functions"

Post by Raindrops »

A technical term like "preprocessor" is not part of a normal user's vocabulary, and may be overwhelming for him.
(He need not get into what is "pre-process", what is "process" and what is "post-process".)

Therefore this term should be replaced with another that is derived from its function (how it serves the user).

Why not just call them "functions" used in search?
After all, the user gets these same items as "functions" in the Search menu!

Or we can just call them "Search tokens", which means that Everything will replace them with a value during the actual search...
Although "token" is also a programming term, at least users can understand "tokens" intuitively.
void
Developer
Posts: 16764
Joined: Fri Oct 16, 2009 11:31 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by void »

There are already Search Functions.

Search Functions are different from the Search Preprocessor.

Quick search function example:
size:>1mb
(search for files with a size larger than 1MB)

Quick preprocessor example:
[year:now:]
(this text is replaced with the current year)



Using the preprocessor to find a filename with the current date as ISO8601:
[year:now:]-[text:month:now:,00]-[text:day:now:,00]
=>
2023-01-28



Combining a search function with the preprocessor:
dm:[year:now:]
=>
dm:2023



The Everything Search Preprocessor is similar to the C preprocessor, hence the similar naming.
The #function: preprocessor functions are applied before search functions.
The #function: preprocessor functions can create multiple search terms.
After the search is broken into search terms using your search operators (space and |), the [function:] preprocessor functions are applied.
Finally, your search functions are executed.



The preprocessor is an advanced feature, while search functions are basic.
There's no mention of the preprocessor in the UI yet.
This may change as the preprocessor matures.
There's also the new Column Formulas which may end up replacing the preprocessor. (same functions, different syntax)



https://en.wikipedia.org/wiki/Preprocessor
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by ChrisGreaves »

void wrote: Sat Jan 28, 2023 5:30 am Quick preprocessor example:
[year:now:]
Cool! This is cooler than Bonavista last Feb 4th (my fifth anniversary here!)

I promise not to dive into preprocessor before I have got my mind around Functions and Modifiers.
But I have two quick toe-in-the-water questions:-

1. Is there some sort of null term so that one can experiment with preprocessing in an Immediate Mode; like the BASIC interpreters of yesteryear?
I can see that [year:now:] is replaced by 2023, but when we get around to experimenting it would be convenient, if not too difficult to implement, to have some way of preserving the string to be processed while displaying the output result, probably all on the search box.
Yes? No?

2. WHEN I get around to playing with preprocessor will I be able to build strings that return "The past twelve months" or "The previous five days" and so on? That is, is there buried in there a facility to build arithmetic-like strings?
Yes? No?

I like preprocessors; been using them since 1968! (IBM 1401)
Good to see them making a comeback, and well worth the price of Everything 1.5 (:lol:)
Cheers, Chris
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by NotNull »

1. The easiest answer:
If this gives any result, the answer is shown in bold font
(just like when searching for "abc" will show "abc" in the results in bold font)

So in this case all files with 2023 in the name will be shown with 2023 in bold.



2. If you could get this done in Excel, there is a good chance it can be done in Everything too.
ChrisGreaves wrote: Mon Feb 20, 2023 7:13 pm well worth the price of Everything 1.5 (:lol:)
Hahaha!
void
Developer
Posts: 16764
Joined: Fri Oct 16, 2009 11:31 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by void »

The preprocessor output is not shown anywhere.
Typically you can see the output highlighted in the filename results.

For example, searching for [year:now:] will highlight 2023 in filenames.



One way to view the output is to use the preprocessor as a search command by prefixing a /

For example:

Type in the following search:

/[year:now:]

Press ENTER in the search box.
The search is replaced with the preprocessor output.


2. WHEN I get around to playing with preprocessor will I be able to build strings that return "The past twelve months" or "The previous five days" and so on? That is, is there buried in there a facility to build arithmetic-like strings?
Yes? No?
You can't execute for loops, or complex scripts.
There are plenty of functions for manipulating strings.

You can evaluate expressions with [eval:]

For example:

[eval:1+1] => 2
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by ChrisGreaves »

NotNull wrote: Mon Feb 20, 2023 8:03 pm If this gives any result, the answer is shown in bold font
Thanks Notnull. Especially for the disclaimer.
Untitled.png
Untitled.png (37.56 KiB) Viewed 2809 times
but I was asking from the raw beginner viewpoint.
When I type in a search string that returns NO results, I might think that I have "done something wrong", in which case some alternate feedback from Everything would be helpful.
Worse than thinking that I have done something wrong is the assumption that either "I am a computer expert and I never make a mistake" or "The computer is never wrong", which is what leads to so many failed companies who build a Budget Spreadsheet and assume that Excel is always right, but also assume that their budget clerk knows what he/she is doing!

In my stamping ground (Word2003/VBA) the Immediate Window allows me to preface a command with a question mark

Code: Select all

?2-3
-1 
so that I can see the result of (in this case a very simple) an arithmetic expression or any valid statement

Code: Select all

?Activedocument.Tables.Count
 0 
Untitled.png
Untitled.png (15.19 KiB) Viewed 2809 times
In the example above, Word/VBA tells me that Word does not have Workbooks. It is Excel that has workbooks!
2. If you could get this done in Excel, there is a good chance it can be done in Everything too.
Thanks. I shall put this on my list, some several weeks down the road, I suspect.
Cheers, Chris
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by ChrisGreaves »

void wrote: Tue Feb 21, 2023 3:09 am One way to view the output is to use the preprocessor as a search command by prefixing a /
/[year:now:]
Thank you Void. This forward slash is what I was looking for; it corresponds to the "?" in the VBA Immediate Window (my response to NotNull above) and to my "1. Is there some sort of null term so that one can experiment with preprocessing".
There are plenty of functions for manipulating strings.
You can evaluate expressions with [eval:]
Thanks too for these answers. My day just got a whole lot brighter :sunshine:
Cheers, Chris
horst.epp
Posts: 1448
Joined: Fri Apr 04, 2014 3:24 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by horst.epp »

2ChrisGreaves
My 2cents to this discussion :)
You are trying to find names for features of Everything a normal user will never make use of.
The type of user which makes use of it have no problems to understand the name preprocessor
or postprocessor which by the way are also used in other environments.
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by ChrisGreaves »

horst.epp wrote: Tue Feb 21, 2023 4:19 pm 2ChrisGreaves
My 2cents to this discussion :)
You are trying to find names for features of Everything a normal user will never make use of.
The type of user which makes use of it have no problems to understand the name preprocessor
or postprocessor which by the way are also used in other environments.
Hi Horst; I think that you might be confusing me with Raindrops. I have been writing and enjoying preprocessors all my working life!
Now I can be accused of hijacking his thread, but he posted right at the time I was exploring what Everything meant by "preprocessor"
Best wishes, Chris
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by Raindrops »

@2ChrisGreaves

IMHO Everything offers many powerful features and commands. So my intent is that these should not be left only to the expert users. With a proper help wiki, even mere mortals can enjoy them.

IMHO, all possible help docs can be graded as follows:
  • Forums are not efficient in conveying such information to the user.
  • A technical manual is better - It explains each screen, control by control.
  • A user manual is the best: It explains the concepts first, and then shows how to achieve the user's needs and workflows.
I can mention two user manuals I created for similarly powerful software: LMMS and ActivePresenter. Both of them are written for the ordinary users. These manuals enable the user to enjoy the most powerful features with ease. Explanation and illustration is the key.

Hopefully we will be able to create the upcoming wiki to serve this purpose. I am waiting for the TOC to be defined. I could have initiated that, but since some members have seniority here, I'd rather defer to let them take that honor! :)
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by NotNull »

Off-topic ...
ChrisGreaves wrote: Mon Feb 20, 2023 7:13 pm I like preprocessors; been using them since 1968! (IBM 1401)
That did ring a bell, but it was too distant to pinpoint where the sound was coming from.
... until I was browsing my music last night and saw the light bell:

Jóhann Jóhannsson - IBM 1401, A User's Manual (2006)

An album with titles like:
Part 1 - IBM 1401 Processing Unit, Part 2 - IBM 1403 Printer and Part 3 - IBM 1402 Card Read-Punch

The best way I can describe this music is neo-classical avantgarde, which does sound like a terribe combination, I know.
As you used quite a few musical references on this forum, thought I'd mention it.
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by ChrisGreaves »

NotNull wrote: Wed Feb 22, 2023 1:01 pm Off-topic ...
Jóhann Jóhannsson - IBM 1401, A User's Manual (2006)
As you used quite a few musical references on this forum, thought I'd mention it.
And, NotNull, please explain to me how I am supposed to get any work done on The User Tutorial about Everything?
20230222_102841.jpg
20230222_102841.jpg (184.62 KiB) Viewed 2715 times
I think that pretty well puts the kibosh on anything at all getting done for the rest of the day; let alone Everything.
David Carpenter probably put you up to this ..... :lol: :lol: :lol: :lol: :twisted:
Cheers, Chris
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Suggestion: Rename "Preprocessor" to "search functions"

Post by NotNull »

ChrisGreaves wrote: Wed Feb 22, 2023 2:03 pm And, NotNull, please explain to me how I am supposed to get any work done on The User Tutorial
There is still hope!!
One of these tracks has someone reciting parts of said manual, accompanied by violins, lots of violins ...
So consider it to be an audiobook :D


BTW: Cool picture!
Post Reply