Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - rrq

#1
newLISP in the real world / Re: replace help
November 13, 2024, 04:38:35 PM
Yes it can be a bit confusing. The string returned by replace does have single-quotes replaced by double-quotes, but the interactive result output presents the double-quotes prefixed by backslash.

Thus, when the string has a double quote, the result printing of that string shows \" so as to indicated that the double-quote is not ending the string. Likewise, the result printing adds the double-quotes before and after printing the string content, and those double-quotes are not characters in the string.

If you make it be
(print (replace ....))then the string will be printed without extras before double-quotes, but the interactive output coming after will still show the string with that meta-character wrapping.

In short, a string of a single double-quote characters is written "\"", and it will be taken as such if input and printed as such by the interactive output. The print function doesn't add meta-characters. Here's an illustration example:
> (println "\"")
"
"\""
>
The first line is what the println function prints (which is the "raw" string content with a newline added at end), and the second line is the interactive output of the value returned by the println function (the same string but with meta-characters to make it be the character sequence the input reader would need).
#2
Fun :)

May I also suggest that you lift out the command key dispatch as a key-action association list between key and action. Eg

(setf ACTIONS '(
    (87 up)    (119 up)
    (65 left)  (97  left)
    (85 down)  (115 down)
    (68 right) (100 right)
    (48 exit) ; "0" --> quit the game
))

The "case" statement would be replaced by something like the following "if" statement:

(if (lookup (setf key (read-key)) ACTIONS) (apply $it)
    (println "Wrong key.") (setq key-error true))

That would open it up slightly for easier change of command keys.
#3
newLISP in the real world / Re: replace help
November 12, 2024, 04:35:25 PM
So 'a gets set to a list of a string ? Did you mean to set it to the string rather? like
(set 'a "{'symbol': 'BURT/USDT', ... 'markPrice': None}")
#4
newLISP in the real world / Re: hmac signatures
October 26, 2024, 01:30:46 PM
Wouldn't you need to use crypto:hmac ?
#5
newLISP in the real world / Re: A simple(?) problem
June 26, 2024, 02:08:55 PM
Yeah. Way faster than mine :)

chhers
#6
newLISP in the real world / Re: A simple(?) problem
June 25, 2024, 05:37:41 AM
This one is straight-forward but probably a bit slow
(define    (randint RANGE DIGITS)
  (letn ((digits (fn (X) (map int (unique (explode (string X))))))
         (wrong (fn (X) (difference (digits X) DIGITS)))
         (S (clean wrong (apply sequence RANGE))))
    (S (rand (length S)))))

EDIT: simplify by using "apply"

EDIT 2: recusive digitization might be faster (?)
EDIT 3: changed back to use stringifying; looks nicer :)
#7
newLISP newS / Re: sending emails to @gmail.com
May 23, 2023, 01:23:05 PM
Au contraire ;D I, at gmail.com, got the notification email from this forum today. Which is great. Something got improved ...
#8
Thanks @itistoday!! Great to be at a new forum home.

Here's a pointer to a few of my newlisp projects

Most of them are functional, but generally they are for fun.
#9
newLISP newS / Re: sending emails to @gmail.com
May 22, 2023, 05:04:52 PM
Eh? Doesn't your ISP provide rDNS setup?

EDIT: it's not related to email as such, and I agree that setting up your own MTA would be too much.

EDIT 2: not sure if relevant:
https://clientarea.ramnode.com/knowledgebase/19/How-do-I-set-reverse-DNS-RDNSorPTR.html
#10
newLISP newS / Re: sending emails to @gmail.com
May 22, 2023, 04:54:09 PM
Well, I'm not trying to support any of Google's business practices; just trying to assist in getting the forum emails delivered to @gmail.com addresses (especially since I happen to have one).

And for that I believe it would be good getting the rDNS sorted for newlispfanclub.com.
#11
newLISP newS / Re: sending emails to @gmail.com
May 22, 2023, 03:59:37 PM
Yes, the MTA setup would be fine, but afaik gmail will want the original sender (newlispfanclub.com) to have rDNS set up (as well), especially for resolvable hosts "without history".
#12
newLISP newS / Re: sending emails to @gmail.com
May 22, 2023, 03:43:25 PM
Ah; I looked up rDNS for 168.235.93.184 and got 168-235-93-184.cloud.ramnode.com rather than newlispfanclub.com, which would be the origin of an email.

#13
newLISP newS / sending emails to @gmail.com
May 22, 2023, 03:33:34 PM
This morning I got a blurb here about the pains of sending emails to addresses @gmail.com, detailing a bit about how finicky they, Google, are.

Whilst that is true, I've held this email address some 20 years mostly because their spam filtering has been quite outstanding. During that time I have set up some number of MTA (typically small and smallish ones), and like apparently this forum, come to realize both that in order to deliver to @gmail.com addresses all the "ducks" need to be in perfect order, and that getting attention and assistance by Google staff to figure out the "ducks" is near impossible.

This forum is close to perfect in its setup apart from lacking its reverse DNS setup, which I believe is one of the "ducks", i.e. one thing that @gmail.com is finicky about.

(And if it'd be of any help. I'm more than happy to be a trial target for MTA configuration trials.)

#14
maybe check out

https://web.archive.org/web/20230000000000*/http://www.newlisp.org/downloads/manual_frame.html">https://web.archive.org/web/20230000000 ... frame.html">https://web.archive.org/web/20230000000000*/http://www.newlisp.org/downloads/manual_frame.html
#15
newLISP in the real world / Re: string function
June 15, 2022, 02:00:08 AM
I'm confused about why you appear confuse... of course (string ""a""b"") is the same as (string ""   a   ""  b  ""); the string function packs together the stringifying of its arguments ignoring any (optional) whitespace between them. No strangeness involved afaict.