Hi Alex, Geo.
Ok, so the lower-case upper-case testing and mapping is actually encoded
into these lists, and the function charType takes the character number in
unicode, modifies it, and uses that as an index in the lists to get that
information. No lookup in a special file. Thanks for correcting
Hi Bruno,
No problem! Glad to hear I was able to help :)
I'm still working on the FPGA version of PicoLisp VM so most of the time I also
do these comparison to have a better understanding how the VM is implemented.
BR,
geo
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Hi Bruno,
> with case mappings, I guess the likely thing is that picolisp uses a text
> file just like that for its case management.
Not a file, but it is directly in global tables. See in "src64/glob.l", as also
mentioned by Geo:
align 2
: CaseBlocks
hx2 ("1C2" "1C2" "1C1" "12C" "12B" "1A
Hi Geo! Thanks a lot for the info!
I did a google search and it turns out Unicode does come with several text
files that create mappings between letters of different cases. The most
important one is UnicodeData.txt. It has the one to one mappings between
lower and upper case.
Though my quick google
I'm a bit surprised about these questions.
Can't you just peek into the source of low? and upp? even from the REPL?
I'm not using picolisp lately but I remember vaguely it had the same
feature as Clojure:
=> (source clojure.string/upper-case)
(defn ^String upper-case
"Converts string to all up
Hi Bruno,
More details:
Pil32:
/*** Case mappings from the GNU Kaffe Project ***/
#define CHAR_UPPERCASE 1
#define CHAR_LOWERCASE 2
#define CHAR_LETTER 62
#define CHAR_DIGIT 512
Pil64:
# Case mappings from the GNU Kaffe Project
(equ CHAR_UPPERCASE 1)
(equ CHAR_LOWERCASE 2)
(equ C
Hi Bruno,
Here are the implementation for both Pil32 and Pil64:
Pil32:
// (low? 'any) -> sym | NIL
any doLowQ(any x) {
x = cdr(x);
return isSym(x = EVAL(car(x))) && isLowc(symChar(name(x)))? x : Nil;
}
// (upp? 'any) -> sym | NIL
any doUppQ(any x) {
x = cdr(x);
return isSym(x = EVA
On the subject of low? and upp?, how does picolisp know if a character is
upper or lower case?
Is there a list of all upper and lower case characters built in to the
interpreter, and the character is checked against that list?
Or is casing information is built into unicode?
On Sat, Jun 17, 2017 at
Hi Alex,
> Yes, 'low?' and "upp?" are a good idea. They do however return true also for
> letters like "ä" / "Ä", so it depends on what the exact task is
Hi Geo,
On Sat, Jun 17, 2017 at 06:07:16AM +, George Orais wrote:
> (de singleLetter? (item) (and (=1 (length item)) (or (low? item) (upp?
> item
Yes, 'low?' and "upp?" are a good idea. They do however return true also for
letters like "ä" / "Ä", so it depends on what the exact task is
(Resend to change to plain text format)
Hi,
How about this:
(de singleLetter? (item)
(if (and (=1 (length item)) (or (low? item) (upp? item)))
1
NIL))
This returns 1 if true then NIL for false.
But if you just need NIL for false and then the letter itself for true, then
can
Hi,
How about this:
(de singleLetter? (item) (if (and (=1 (length item)) (or (low? item) (upp?
item))) 1 NIL))
This returns 1 if true then NIL for false.
But if you just need NIL for false and then the letter itself for true, then
can be shorten into this:
(de singleLetter? (item) (and (=1
On Sat, Jun 17, 2017 at 07:35:44AM +0200, Alexander Burger wrote:
> On Fri, Jun 16, 2017 at 06:31:06PM -0800, Christopher Howard wrote:
> > Hi list. In picolisp, what would be the simplest way to check if a
> > string (trans sym) is one character long and that the character is one
> > of the letter
On Fri, Jun 16, 2017 at 06:31:06PM -0800, Christopher Howard wrote:
> Hi list. In picolisp, what would be the simplest way to check if a
> string (trans sym) is one character long and that the character is one
> of the letters a-z or A-Z?
I would do:
(member C '`(mapcar char (conc (range 65 90
Thanks!
On 06/16/2017 08:29 PM, Mike Pechkin wrote:
> https://bitbucket.org/mihailp/tankfeeder/src/70c0cfb9e8e3adf4737f70a23a9d4b615d74e4ff/onechar.l?at=default&fileviewer=file-view-default
>
> On Sat, Jun 17, 2017 at 5:31 AM, Christopher Howard
> mailto:christopher.how...@qlfiles.net>>
> wrote:
https://bitbucket.org/mihailp/tankfeeder/src/70c0cfb9e8e3adf4737f70a23a9d4b615d74e4ff/onechar.l?at=default&fileviewer=file-view-default
On Sat, Jun 17, 2017 at 5:31 AM, Christopher Howard <
christopher.how...@qlfiles.net> wrote:
> Hi list. In picolisp, what would be the simplest way to check if a
Hi list. In picolisp, what would be the simplest way to check if a
string (trans sym) is one character long and that the character is one
of the letters a-z or A-Z?
--
https://qlfiles.net
--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
17 matches
Mail list logo