词条 | Sam (text editor) |
释义 |
}}{{Infobox software | name = Sam | logo = | screenshot = Sam text editor.png | caption = A screenshot of Sam | collapsible = | author = Rob Pike | developer = Bell Labs | released = early 1980s | latest release version = | latest release date = {{start date and age|2003|07|04}} | latest preview version = | latest preview date = | programming language = C | operating system = Unix, Plan 9, Win32 | platform = | size = | language = English | genre = Text editor | license = Lucent Public License | website = {{URL|sam.cat-v.org}} }} Sam is a multi-file text editor based on structural regular expressions. It was originally designed in the early 1980s at Bell Labs by Rob Pike with the help of Ken Thompson and other Unix developers for the Blit windowing terminal running on Unix; it was later ported to other systems. Sam follows a classical modular Unix aesthetic. It is internally simple, its power leveraged by the composability of a small command language and extensibility through shell integration. Design and featuresSam is designed as two synchronous programs: a command interpreter and a mouse-oriented bitmap windowing interface. The interpreter's command set is modeled after the UNIX editor ed and may be used to operate the editor from a standard text terminal. By default, however, Sam presents its own graphical user interface (GUI) window, samterm, which additionally allows point-and-click operations through pop-up context menus. This two-process structure allowed sam to access files on networked host systems through remote execution of the file-access process while running the windowing interface locally, thereby bypassing latency over slow connections. Samterm presents windows to files being edited and to a persistent command window which accepts input as sam commands. Most common editing operations are quickly and naturally accomplished with the point-and-click interface, which also functions inside the command window. This latter fact allows commands to be edited (and resubmitted) just as any other text, a function inherited from the DMD 5620 terminal interface. Command SyntaxSam's command syntax is formally similar to ed's or ex's, containing (structural-) regular expression based conditional and loop functions and scope addressing, even sharing some of ed's syntax for such functions. But while ed's commands are line-oriented, sam's are selection-oriented. Selections are contiguous strings of text (which may span multiple lines), and are specified either with the mouse (by sweeping it over a region of text) or by a pattern match. Sam's commands take such selections as basic—more or less as other Unix tools treat lines; thus, multi-line and sub-line patterns are as naturally handled by Sam as whole-line patterns are by ed, vi, AWK, Perl, etc. This is implemented through a model called structural regular expressions, which can recursively apply regular-expression matching to obtain other (sub)selections within a given selection. In this way, sam's command set can be applied to substrings that are identified by arbitrarily complex context. Sam extends its basic text-editing command set to handling of multiple files, providing similar pattern-based conditional and loop commands for filename specification. Any sequence of text-editing commands may be applied as a unit to each such specification. Infinite UndosSam was one of the first text editors to support "infinite" undo to revert any number of editing errors. This feature, combined with Sam's facility to easily edit its own commands and, fundamentally, its small, orthogonal command set (containing only 33 commands), represent the program's bias toward a low learning threshold over other more expressive "power editors." EndorsersSam is the preferred text editor of several eminent programmers. It was the first full screen editor Ken Thompson liked.[1] Sam is the text editor used by Bjarne Stroustrup,[2] Brian Kernighan,[3] Douglas McIlroy and Tom Duff. Others, like Dennis Ritchie, Rob Pike and Russ Cox, have transitioned{{why|date=November 2016}} to acme instead. The latest version of sam was written as part of the Plan 9 operating system, but there are Microsoft Windows, Mac OS X and X Window System ports available. See also{{Portal|Free and open-source software}}
Notes1. ^[https://interviews.slashdot.org/story/04/10/18/1153211/rob-pike-responds Interview:Rob Pike Responds], Posted by Roblimo on Monday October 18, 2004, Slashdot 2. ^{{cite interview |last=Rzeszótko |first=Jarosław |date=2006-10-16 |title=Stiff asks, great programmers answer |work=Stifflog |url=http://www.stifflog.com/2006/10/16/stiff-asks-great-programmers-answer |accessdate=2008-11-01 |deadurl=yes |archiveurl=https://web.archive.org/web/20111005145715/http://www.stifflog.com/2006/10/16/stiff-asks-great-programmers-answer |archivedate=October 5, 2011}} 3. ^{{cite interview |last=Kernighan |first=Brian |date=July 2000 |title=An Interview with Brian Kernighan |interviewer=Budiu, Mihai |url=http://www.cs.cmu.edu/~mihaib/kernighan-interview/ |accessdate=2008-11-01}} References
External links
6 : Free text editors|Plan 9 from Bell Labs|Inferno (operating system)|Unix text editors|MacOS text editors|Windows text editors |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。