Changeset 40185 in project


Ignore:
Timestamp:
06/14/21 10:00:23 (3 months ago)
Author:
Idiomdrottning
Message:

Adding strse? operator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/strse

    r40096 r40185  
    1 [[tags: egg]]
    2 [[toc:]]
    31
    42== strse
    5 
     3[[toc:]]
    64Strse (rhymes with terse) is a string DSL for Scheme.
    75
     
    6159        "tiger" (then (print "I saw a cat!")))
    6260
    63 I saw a hippo!
    64 
    65 â‡’ "hippopotamus"
     61I saw a hippo!br⇒ "hippopotamus"
    6662
    6763Another example:
     
    148144        "o" (begin (print "Found o") "i") #f)
    149145
    150 Found a
    151 
    152 â‡’ #f
     146Found abr⇒ #f
    153147
    154148A zero means to replace the entire string, not just the matched part,
     
    166160match.
    167161
    168 ==  Author
    169162
    170 [[https://idiomdrottning.org/about|Idiomdrottning]]
     163=== strse?
     164 (strse? str reg)
    171165
    172 == Repository
     166Just returns #t if reg is in str and #f otherwise.
    173167
    174 git clone https://idiomdrottning.org/strse
     168 (strse? reg)
    175169
    176 == License
     170Returns a predicate that takes a str argument and checks if reg is in it.brIn other words, it's curried on it's ''second'' argument, kind of a
     171backwards currying but often convenient.
    177172
    178  Â© 2021 Idiomdrottning.
     173For a repo,
    179174
    180  All rights reserved.
     175 git clone https://idiomdrottning.org/strse
    181176
    182  Redistribution and use in source and binary forms, with or without
    183  modification, are permitted provided that the following conditions are
    184  met:
    185 
    186  1. Redistributions of source code must retain the above copyright
    187  notice, this list of conditions and the following disclaimer:
    188 
    189  This software is provided by Idiomdrottning "as is" and any express or
    190  implied warranties, including, but not limited to, the implied
    191  warranties of merchantability and fitness for a particular purpose are
    192  disclaimed. In no event shall Idiomdrottning be liable for any direct,
    193  indirect, incidental, special, exemplary, or consequential damages
    194  (including, but not limited to, procurement of substitute goods or
    195  services; loss of use, data, or profits; or business interruption)
    196  however caused and on any theory of liability, whether in contract,
    197  strict liability, or tort (including negligence or otherwise) arising
    198  in any way out of the use of this software, even if advised of the
    199  possibility of such damage.
Note: See TracChangeset for help on using the changeset viewer.