Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Parse Problem

From: louisaturk::coxinet::net at: 29-Oct-2001 15:21

Friends, Why doesn't the following program work? It should find field/1 in ibidem and replace it with field/2 (see Modify the String in the Parsing section of the Users Guide). Louis REBOL[ Title: "Ibidem2BibTeX" Date: 29-Oct-2001 Version: 0.1 File: %Ibidem2BibTeX.r Author: "Louis A. Turk" Email: [louisaturk--eudoramail--com] Language: 'English Purpose: "Converts NBWin Ibidem files to BibTeX format." Comments: {Be sure to compact your Ibidem data file before using this program.} ] ibidems: parse/all read %turk.bib "¶" fields: [ ["AU:" "author = "] ["ST:" "Short Work Title = "] ["BT:" "Long Work Title = "] ] foreach field fields [ foreach ibidem ibidems [ ;if find ibidem field/1 [print field/1] ; THIS LINE WORKS parse ibidem [any [to field/1 mark: (change mark field/2) skip]] ;WHAT'S WRONG WITH THIS LINE? print ibidem ] ] I get the following error message:
>> do %ibidem2bibtex.r
** Script Error: Invalid argument: field/1 ** Where: halt-view ** Near: parse ibidem [some [to field/1 mark: (change mark field/2) skip]] print ibidem
The file %turk.bib contains data in the following format: R#:9¶ AU:Antonio, Gene¶ BT:AIDS: rage & reality---why silence is deadly¶ BC:Feldschuh, Joseph, M.D. <foreword by>¶ PL:Dallas¶ PR:Anchor Books¶ YR:1992¶ LG:317 pp¶ KW:AIDS; homosexual; gay; sodomy¶ ®PG¯ R#:10¶ AU:Lamont, Corliss¶ BT:The illusion of immortality¶ BC:Dewey, John¶ SR:Half-moon Foundation, Inc.¶ PL:New York¶ PR:The Continuum Publishing Company¶ YR:1990 <1935>¶ LG:303 pp.¶ KW:humanism; ACLU¶ AN:Born in Englewood, New Jersey in 1902, Dr. Lamont graduated first from Phillips Exeter Academy in 1920, then magna cum laude from Harvard University in 1924. He did graduate work at Oxford and at Columbia, where he received his Ph.D. in philosophy in 1932. He was a director of the American Civil Liberties Union from 1932 to 1954, and is currently chairman of the National Emergency Civil Liberties Committee. A leading proponent of the individual’s rights under the Constitution, he has won famous court decisions over Senator Joseph McCarthy, the CIA, and in 1965 a Supreme Court ruling against censorship of incoming mail by the U.S. Postmaster General. Dr. Lamont has long been associated with Humanism, and authored the standard text on the subject, ®MDUL¯The Philosophy of Humanism®MDNM¯, in 1949. He taught at Columbia, Cornell, and Harvard Universities, and at the New School for Social Research. Corliss Lamont is currently honory president of the American Humanist Association.¶ ®PG¯ R#:11¶ AU:Hatcher, William S.; Martin, J. Douglas¶ BT:The Baha¶ ®PG¯ R#:12¶ AU:Hatcher, William S.; Martin, J. Douglas¶ BT:The Baha’i Faith¶ PL:San Francisco¶ PR:Harper & Row¶ YR:1984¶ LG:226 pp¶ KW:Baha’i; humanism¶ ®PG¯ R#:13¶ AU:Storer, Morris B. <ed>¶ BT:Humanist ethics: Dialogue on Basics¶ PL:Buffalo, New York¶ PR:Prometheus Books ¶ YR:1980¶ LG:303 pp¶ KW:humanist, humanism, ¶ ®PG¯ R#:14¶ ST:Kids and guns: a report from America’s classroom killing grounds¶ YR:1992¶ JR:Newsweek¶ DT:March¶ PG:cover¶ KW:violence; school; education; corporal punishment¶ ®PG¯ R#:15¶ ST:Shocking lesson in shame and terror¶ YR:1993¶ JR:National Examiner¶ DT:9 Nov¶ PG:7¶ KW:violence; school; education; guns¶ ®PG¯ R#:16¶ ST:The blackboard jungle---America’s Schoolyards are tragic killing fields where no child is safe¶ YR:1993¶ JR:National Examiner¶ DT:9 Nov¶ PG:7¶ KW:violence; school; education; guns¶ ®PG¯