You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One way to compile strings is to have a byte array of ascii values, where each character is represented by their numerical value (E.G. #\D = 100).
packing by byte concatenation
Another interesting technique, if the array is inefficinet. Is to pack the string bitwise. E.G:
"df";; this is really'(100102)
;; We can now pack this into one elemnt by bit shifting the 100;; and adding the 102 to the bitshifted value, concatenating them!
(cl:+ (ash1007) 102)
#b11001001100110
However it needs to be noted that we should know the field size, and make sure we don't overflow this when shifting. Thus we should have a small array of these values if we do go over size
The text was updated successfully, but these errors were encountered:
We should support string and string literals
Strategies
Using Arrays
One way to compile strings is to have a byte array of ascii values, where each character is represented by their numerical value (E.G.
#\D
= 100).packing by byte concatenation
Another interesting technique, if the array is inefficinet. Is to pack the string bitwise. E.G:
However it needs to be noted that we should know the field size, and make sure we don't overflow this when shifting. Thus we should have a small array of these values if we do go over size
The text was updated successfully, but these errors were encountered: